Add validation of custom grok patterns file
See original GitHub issueContext
The support of custom grok patterns was added in #15
Just add the directory with name Patterns and a file (the file name doesn’t matter) with your own patterns.
Like Patterns\grok-custom-patterns:
ZIPCODE [1-9]{1}[0-9]{2}\s{0,1}[0-9]{3}
and use:
Grok grok = new Grok("%{ZIPCODE:zipcode}:%{EMAILADDRESS:email}");
var grokResult = grok.Parse($"122001:Bob.Davis@microsoft.com");
IndexOutOfRangeException
There is an issue when that custom file has the wrong content.
How to reproduce
Add to the Patterns\grok-custom-patterns the following data:
pattern
How to fix
Add some validation on load of custom grok file content. It should be pattern name, space, then the regexp for that pattern
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (8 by maintainers)
Top Results From Across the Web
Grok Custom pattern file - Logstash
Hi guys, I'm starting in logstash's world and i'm having a problem to set more than one custom grok pattern into a "patern_dir"...
Read more >Tutorial: Logstash Grok Patterns with Examples
With the Grok Debugger, we can copy and paste the example log line in the first “Input” field and the Grok filter in...
Read more >Using field as input to Logstash Grok filter pattern
The answer is no -- the grok filter compiles its pattern when the filter ... :validate => :boolean, :default => false # Append...
Read more >Writing custom classifiers - AWS Glue
AWS Glue provides many common patterns that you can use to build a custom classifier. You add a named pattern to the grok...
Read more >How To Use Custom Patterns On Grok Filter For Logstash ...
In order to add new patterns we will need to create a new file. The way we are going to do it is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I am busy with some work this month. You can can assign it someone else. No issue with me.
Hi @MazixM and @GioMaz, Thanks for your interest. You need to create a Pull Request with changes. Then we can choose the best one