Shell split analysis Log File

Source: Internet
Author: User

The comment format of the shell split analysis log file is as follows :.......................... .. xxx. xxx.10.59 db1059 mynbdpdatadb. idc4. dbname R620 master IDC2 Y Yxxx. xxx.11.59 db1159 mynbdpdatadw. idc4. dbname R620 slave IDC1 Y Yxxx. xxx.10.90 db1090-dbname1, dbname2, dbname3 R620 slave IDC3 Y Yxxx. xxx.11.90 db1190-dbname1, dbname2, dbname3 R620 slave IDC2 Y Yxxx. xxx.10.94 db1094 myuetdb. idc4. dbname Gen8 master IDC1 Y ................................ analyze the following ip Host Name Domain Name schema host hardware device Master/Slave Data Center other monitoring shell script analysis: cat/tmp/comment | awk '{split ($1, key1, ". "); split ($2, key2," | "); {if (key2 [3] =" ") key2 [3] = "-"}; {if (key2 [4] = "") key2 [4] = "-"}; {if (key2 [5] = "") key2 [5] = "-"}; print $1, "db" key1 [3] key1 [4], key2 [4], key2 [3], key2 [5], key2 [2], key2 [6], "Y"} '>/root/fenxi.txt

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.