在日志文件GROK模式中容纳不确定数量的空间 [英] Accommodate uncertain number of Spaces in a log file GROK pattern

查看:77
本文介绍了在日志文件GROK模式中容纳不确定数量的空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这可能是一个简单的问题,但是在我的日志中,不同字段之间的空格是不确定的,这意味着在某些日志中,我可以看到两个空格,而在相同字段之间则可以看到三个空格.我们如何在GROK中容纳这个?

This may be a simple question, but in my logs the spaces between different fields are uncertain, that mean in some logs I can see two spaces and in some three between the same fields. How do we accommodate this in GROK?

推荐答案

您可以在grok模式中使用%{SPACE} * 来匹配非标准的空格数.即使没有空格,它也会匹配.

You can use %{SPACE}* in your grok pattern for matching uncertian number of spaces. It will match even if spaces are present or not.

这篇关于在日志文件GROK模式中容纳不确定数量的空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆