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.

ac92ec61-5a5c-df11-beff-001ec95274b6,8b2135d0-ba04-4473-8398-3e0e1045c7c4

I am trying in the following way

filter
{
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.