bruinjoe
(Joe Bruin)
April 10, 2019, 2:23am
1
I have a mainframe export. I need to parse it based on column position. Does Logstash grok support extraction based on column position?
Example line: M4349456
First two characters dept number: M4
Characters 3-6 mail stop: 3494
Characters 7-8 room number: 56
inhinyera16
(Archelle Pagapulan)
April 10, 2019, 10:25am
2
Hi maybe you can follow this solution.
hi guys,
if i want to extract first 3 characters from a field, how do i go about it.
Thanks,
sam
You can create a separate ruby code block and put the zero based integer.
Badger
April 10, 2019, 11:05am
3
You can do it in grok using
grok { match => { "someField" => "^(?<dept>..)(?<mailstop>....)(?<room>..)" } }
1 Like
bruinjoe
(Joe Bruin)
April 12, 2019, 4:23pm
4
Thank you Archelle and Badger both information was useful. I ended up using Badger's recommendation.
system
(system)
Closed
May 10, 2019, 4:23pm
5
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.