问题
I need the common RE for representing the below values
Invoice_IID: 00000000-4164-1638-e168-ffff08d24460
Invoice_IID 00000000-4164-1638-e168-ffff08d24460
invoice iid 00000000-4164-1638-074f-ffff08d24461
<invoice iid="00000000-4164-1638-074f-ffff08d24461"
<invoice iid=\"00000000-4164-1638-074f-ffff08d24461\"
<parent_invoice iid="00000000-4164-1638-074f-ffff08d24461"
I am trying with the below configuration with my grok debugger like
http://grokconstructor.appspot.com/do/match#result
grok {
match => { "msg" => "[iI]no*voice[_,\" \"][iI][iI][dD]:? %{UUID:InvoiceIID}" }
}
I need the common support for all types of content in one Regular Expression
回答1:
Yes, I got the solution for all above types of data.
matching pattern is:
grok {
match => { "msg" => "[<]*[parent_]*[<]*[iI]no*voice[_,\" \"][iI][iI][dD][" "]*:?[" "]*=?[\\,\"]*%{UUID:InvoiceIID}[\",\\]*" }
}
来源:https://stackoverflow.com/questions/31447198/common-regular-expression-for-grok-matching-pattern