Common regular expression for grok matching pattern

核能气质少年 提交于 2019-12-13 07:56:59

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!