Can anyone help me getting right Grok pattern to retrieve only id value from below sample logs(only message part) from nifi
- o.a.n.c.s.StandardControllerServiceNode StandardControllerServiceNode[service=DBCPConnectionPool[id=5609ac16-0174-1000-eeee-ffffd19aae44]
- o.a.n.c.s.StandardControllerServiceNode Failed to invoke @OnEnabled method of DBCPConnectionPool[id=5609ac16-0174-1000-hhhh-ffffd19aae44]
- o.a.n.c.s.StandardControllerServiceNode Failed to invoke @OnEnabled method of DBCPConnectionPool[id=5609ac16-0174-1000-gggg-ffffd19aae44]*
I have tried using the below pattern but it is retrieving the whole message but unable to get id value separately
- %{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:severity} [%{DATA:thread}] %{DATA:class} %{GREEDYDATA:message}
If you only want to extract the id then you can use the following pattern.
This will match on the [id= and then grab everything before the next ].
You could make this more robust by defining a custom pattern that more accurately matched the ID pattern, rather than using DATA.
I use the following resources for GROK patterns