I am newbie and trying to add a field as "cid" in with my logs based on this pattern
2018-03-14 22:26:57.268 INFO 22996 --- [nio-8090-exec-2] com.example.ms1.service.ValidatorImpl : validation completed with cid: ms1-0-8a7e131b-1730-45f2-a72d-c2bc7cba4b93
2018-03-14 22:26:57.470 INFO 22996 --- [nio-8090-exec-2] com.example.ms1.service.ProcessorImpl : processing completed with cid: ms1-0-8a7e131b-1730-45f2-a72d-c2bc7cba4b93
I have created a file for my custom pattern named as "CORRELATIONID [A-Fa-f0-9]{3}-[0-9]{1}-[A-Fa-f0-9]{8}-(?:[A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12}" and I am using this grok
Thanks for your reply, I have updated my grok like this
grok {
match => [ "message", "(?[A-Za-z0-9]{3}-[0-9]{1}-[A-Fa-f0-9]{8}-(?:[A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12})" ]
}
since first two letters can be from a to z, but now it is giving me regex error
Cool it worked, just modified my grok like this
grok {
match => [ "message", "(?[A-Za-z0-9]{3}-[0-9]{1}-[A-Fa-f0-9]{8}-(?:[A-Fa-f0-9]{4}-){3}[A-Fa-f0-9]{12})" ]
}
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.