我是新來玩正則表達式,但想知道我們是否可以有任何正則表達式來捕獲下面的數據。我想在下面的日誌中看到「A」後的所有內容。從DNS捕獲獲得記錄
3 0.238497 x.x.x.x -> x.x.x.x DNS 101 Standard query 0xab5d A servicesx.x.x.x
6 0.241131 x.x.x.x -> x.x.x.x DNS 117 Standard query response 0xab5d A x.x.x.x
7 0.407185 x.x.x.x -> x.x.x.x DNS 100 Standard query 0x7699 A vipservices-x.x.x.x
8 0.409849 x.x.x.x -> x.x.x.x DNS 116 Standard query response 0x7699 A x.x.x.x
9 2.905559 x.x.x.x -> x.x.x.x DNS 101 Standard query 0x9c5d A servicesx.x.x.x
10 2.908308 x.x.x.x -> x.x.x.x DNS 117 Standard query response 0x9c5d A x.x.x.x
11 3.261304 x.x.x.x -> x.x.x.x DNS 101 Standard query 0x9575 A servicesx.x.x.x
12 3.263582 x.x.x.x -> x.x.x.x DNS 117 Standard query response 0x9575 A x.x.x.x
13 4.898380 x.x.x.x -> x.x.x.x DNS 101 Standard query 0x451a A servicesx.x.x.x
14 4.900842 x.x.x.x -> x.x.x.x DNS 117 Standard query response 0x451a A x.x.x.x
15 5.406778 x.x.x.x -> x.x.x.x DNS 100 Standard query 0x4f52 A vipservices-x.x.x.x
我想輸出這樣的東西。
A servicesx.x.x.x
A vipservices-x.x.x.x
A servicesx.x.x.x
任何鉛將不勝感激。
這'grep -o'A。*''?? –
@PS。答對了。那是我以後的事情。 –