使用查询从splunk事件中使用regEx(“ message”:“ TransactionRefNo =====> 37010072”)提取此特定模式?

以下是splunk事件:

,“类”:“ com.tmobile.supplychain.inventoryreceive.service.impl.ReceiveNotificationServiceImpl”,“ sessionid”:“ 41870177”,“ requesttimestamp”:“” 2019-11-20T07:18:04Z“,”消息“:” TransactionRefNo =====> 37010072 insertReceiveNotification RMA-105中的CassandraGemfireWriteException |将接收通知有效载荷持久保存到Cassandra DB中时发生错误-接收通知。

我正在尝试使用正则表达式捕获splunk中所有事件的Transref编号。我正在用这个 下面的查询,但它不起作用。

(index = scs_det源类型= scs_det_apps cf_org_name =“零售-库存-串行化” cf_space_name =生产cf_app_name =“ *” cf_app_name =“ soa-receive-service”“ RMA-105” | rex field = _raw“ transactionRefNo :( ?\ d +)“ |表_time transaction_ref_no

index = scs_det源类型= scs_det_apps cf_org_name =“零售-库存-串行化” cf_space_name =生产cf_app_name =“ *” cf_app_name =“ soa-接收服务”“ RMA-105” | rex field = _raw“ message:(?\ w +)” |表_time transaction_ref_no

index = scs_det源类型= scs_det_apps cf_org_name =“零售-库存-串行化” cf_space_name =生产cf_app_name =“ *” cf_app_name =“ soa-接收服务”“ RMA-105” | rex field = _raw“ message :(?)” |表_time消息

所有人都无法正常工作。您能否请一位帮助我如何使用正则表达式捕获trasref编号。 您的帮助将不胜感激。

谢谢, 拉梅什

hscooler 回答:使用查询从splunk事件中使用regEx(“ message”:“ TransactionRefNo =====> 37010072”)提取此特定模式?

rex field=_raw "TransactionRefNo =====> (?<transactionRefNo>\d+)"

消息中是否总是有5 =符号?如果更改,您可以尝试

rex field=_raw "TransactionRefNo =+> (?<transactionRefNo>\d+)"
本文链接:https://www.f2er.com/3062705.html

大家都在问