Skip to main content
Question

Preserving dual values for a field in parser function extract mode.

  • Mar 11, 2025 3:14 AM UTC
  • 19 replies
  • 109 views

Eugene Katz

i am using parser function in extract mode for a key value pair data source. What I noticed is that, some of the events have two values for the same field `rule_uid = "1234556" | rule_uid = "78938794"` . Cribl seem to be keeping the second value for rule_uid field. What is a right way to preseve both the values for a field? I wonder if parser is the right choice for this.

19 replies

David Maislin

Parser keeps the last value found


Eugene Katz
  • Author
  • Employee
  • Mar 11, 2025 4:41 AM UTC

okay, let me try that


David Maislin

You could use Regex which would extract an array of matches.


Eugene Katz
  • Author
  • Employee
  • Mar 11, 2025 4:41 AM UTC

Thank you David


Eugene Katz
  • Author
  • Employee
  • Mar 11, 2025 4:41 AM UTC

<@U01C35EMQ01&gt; were you suggesting to use Type = Regular expression in the parser function?


David Maislin

No, using the Regular Expression Function


Eugene Katz
  • Author
  • Employee
  • Mar 11, 2025 4:41 AM UTC

ok


David Maislin

We have name value support to auto create keys from the values.


Eugene Katz
  • Author
  • Employee
  • Mar 11, 2025 4:41 AM UTC

i was testing out the regular expression Type in parser and that seem to be working out as well


David Maislin

There is no RegEx type I am aware of in the Parser Function?


David Maislin

If you are referring to JSON, then you will also lose key values as you saw when the key is the same.


Eugene Katz
  • Author
  • Employee
  • Mar 11, 2025 4:41 AM UTC

0


Eugene Katz
  • Author
  • Employee
  • Mar 11, 2025 4:41 AM UTC

i was talking about this


David Maislin

Ah, that is the new 4.1 enhancement to Parser right?


David Maislin

It is basically the Regex Function inside the Parser function right?


Eugene Katz
  • Author
  • Employee
  • Mar 11, 2025 4:42 AM UTC

Not sure when this was released, very useful though!


David Maislin

Did you still need help with that?


Eugene Katz
  • Author
  • Employee
  • Mar 11, 2025 4:42 AM UTC

yea, looks like that way


Eugene Katz
  • Author
  • Employee
  • Mar 11, 2025 4:42 AM UTC

I am good now. Thanks for your help!