简体   繁体   English

QRadar,解析日志

[英]QRadar, parsing Log

I want to parse some application log, I did a lot of regex that works correctly with notepad++ and the website www.regex101.com . 我想解析一些应用程序日志,我做了很多正则表达式,可与notepad++和网站www.regex101.com一起正常使用。 But when I apply them in QRadar they don't match nothing. 但是,当我在QRadar应用它们时,它们什么都不匹配。

For example 例如

12/2/2017 9:53:58,4040007,blablablbla,blablabla --- Abonnement Mobile N° : 0663016666 | 2017年12月2日9:53:58,4040007,blablablbla,blablabla --- Abonnement Mobile N°:0663016666 | balbalbal | balbalbal | 03/06/2006 11:11:22 --- Soldes,10.10.10.10 2006/03/06 11:11:22 --- Soldes,10.10.10.10

I did this regex (?<=---)\\s+[A-Za-z+ \\/\\w+0-9._%+-]+(?=(\\sN°|\\s\\sN°|\\sID)) to match Abonnement mobile it works correctly , but it doesn't match anything in QRadar . 我做了这个正则表达式(?<=---)\\s+[A-Za-z+ \\/\\w+0-9._%+-]+(?=(\\sN°|\\s\\sN°|\\sID))以匹配Abonnement mobile它可以正常运行,但与QRadar中的任何内容都不匹配。

QRadar does not accept all regex configurations. QRadar不接受所有正则表达式配置。 When you try parsing something you can use extract property field to check. 当您尝试解析某些内容时,可以使用提取属性字段进行检查。 Here is a regex that works fine in my system. 这是一个在我的系统中正常工作的正则表达式。

 \-\-\-\s(\w+\s\w+)\s

this regex will work if only "Abonnement Mobile" field is includes letters or digits. 如果仅“ Abonnement Mobile”字段包含字母或数字,则此正则表达式将起作用。 If you want to catch "Abonnement Mobile N°" you can use this regex and this will work whatever comes in this field. 如果您想获取“ Abonnement Mobile N°”,则可以使用此正则表达式,无论该字段中的内容如何,​​它都可以使用。

 \-\-\-\s([^\:]+)\:

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM