Ruby filter to extract different data elements from a string based on pattern

Hi,

I need to extract data from a field transaction which contains value as:

Transaction =
"CHE_ECSTATE '-259297525' 19802619:-259297525{0}BEACH.TCN4(TCN4)ECN4/UTR023/ECTBR@20210929.162523.985

I need fields like
CHE_ECSTATE='-259297525'
key1 = 19802619
key2=259297525
version={0}
name=BEACH.TCN4(TCN4)ECN4/UTR023/ECTBR
trans-time=20210929.162523.985

Then convert the trans time to the datetime

Thanks

Why do you want to do that using a ruby filter instead of grok?

Thanks @Badger for your suggestion.

I thought ruby would be more better but i figured this pattern works for grok for my transaction

(?\s*)\s*'(?.)'\s(?\d+):-\s*(?\d+){\d+}(?.)((?.).)(?.)@(?.*)

Thanks

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