Grok Pattern for text file

Hi all,

I'm trying to parse an text file and am not able to grok the PKey in these text.
Please find the sample text file below.


I am trying in the following way

grok {
match => ["message","%{DATA:ModelID},%{GREEDYDATA}"]
match => ["GREEDYDATA","{DATA:Pkey}</PKey>"]

Please guide me whether I am going in correct way.

Thanks in advance

Wouldn't it be easier to just use a csv filter here? If not I recommend (?<fieldname>[^,]+) which matches a sequence of characters up to the first comma.

match => ["GREEDYDATA","{DATA:Pkey}"]

I don't know what you're trying to do here.

Thanks magnus

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.