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