Logstash grok 过滤器正则表达式
Logstash grok filter regex
我正在尝试使用 grok 清除 ELK 堆栈中的日志条目。我还有以下文本需要处理:
/mnt/drive/fish/Cap Camel/Indigo - [Fair Game].jpg (34523) [2,0,34523,0,0,2,2]
/mnt/drive/fish/Cap Camel/Indigo - [Fair Game].jpg
/mnt/drive/fish/Cap Camel (1358)/Indigo - [Fair Game].jpg
我想要路径,但它包含空格、大写字母和特殊字符等?
谢谢
由于您的第三个示例包含“(”,我们无法使用它来发现第一行中的更改。
似乎将这些行联系在一起的唯一想法是“.jpg”。你说不一定都是jpg,但希望都有后缀。
根据该假设 - 并且路径本身不包含任何句点,此模式适用于调试器:
(?<file>[^\.]*\.[^ ]*)
"Anything that is not a period, followed by a period, followed by anything that is not a space".
我正在尝试使用 grok 清除 ELK 堆栈中的日志条目。我还有以下文本需要处理:
/mnt/drive/fish/Cap Camel/Indigo - [Fair Game].jpg (34523) [2,0,34523,0,0,2,2]
/mnt/drive/fish/Cap Camel/Indigo - [Fair Game].jpg
/mnt/drive/fish/Cap Camel (1358)/Indigo - [Fair Game].jpg
我想要路径,但它包含空格、大写字母和特殊字符等?
谢谢
由于您的第三个示例包含“(”,我们无法使用它来发现第一行中的更改。
似乎将这些行联系在一起的唯一想法是“.jpg”。你说不一定都是jpg,但希望都有后缀。
根据该假设 - 并且路径本身不包含任何句点,此模式适用于调试器:
(?<file>[^\.]*\.[^ ]*)
"Anything that is not a period, followed by a period, followed by anything that is not a space".