This is the data
10:43:19.538281|TraceDetail |UPBSStandardGenericBillPaymentComponent.PostBillPaymentTransaction|Total Time 19/06/2019 10:43:19.538281|TraceDetail |UPBSStandardGenericBillInquiryComponent.GetBillInquiry()|Total Time |2361748 | Consumer Number [0312122221212 ] , UCID [KLOJ0001] , Sending Time [10:43:17.8425459] Receive Time [10:43:18.4941158] Total Time [0:0:651] STAN is [345949]
I want output
[0312122221212 ]
[KLOJ0001]
[10:43:17.8425459]
[10:43:18.4941158]
[0:0:651]
[345949]
I have tried so many commands but didn't able to achieve the result with following command:
grep -oP 'Consumer Number \K.{26}|UCID \K.{10} |Sending Time \K.{09}|Receive Time \K.{09}|Total Time \\[ \K.{8}|STAN is \K.{8}' /root/Documents/a.txt
I got output without total time:
[0312122221212 ]
[KLOJ0001]
[10:43:17.8425459]
[10:43:18.4941158]
[345949]
And when I try this command:
grep -oP 'Consumer Number \K.{26}|UCID \K.{10} |Sending Time \K.{09}|Receive Time \K.{09}|Total Time \K.{8}|STAN is \K.{8}' /root/Documents/a.txt
I got invalid values in output:
19/06/
[0312122221212 ]
[KLOJ0001]
[10:43:17.8425459]
[10:43:18.4941158]
[0:0:651]
[345949]