Working with key_value logs when one of the keys does not have a value? #10552
-
I'm working on extracting data from an IP Tables log using VRL, but because the fields aren't always populated, VRL seems to have issues when using the As an example, the line
produces |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Playing in the REPL I get this: $ parse_key_value!(.message, whitespace: "strict")
{ "DF": true, "DPT": "9100", "DST": "10.x.x.x", "ID": "62910", "IN": "eth1", "LEN": "60", "MAC": "fc:ff:da:47:af:13:b4:2e:99:19:12:00:00:00", "OUT": "", "PREC": "0x00", "PROTO": "TCP", "RES": "0x00", "SPT": "47468", "SRC": "10.x.x.x", "SYN": true, "TOS": "0x00", "TTL": "63", "URGP": "0", "WINDOW": "64240" }
$ parse_key_value!(.message, accept_standalone_key: false, whitespace: "strict")
{ "DF PROTO": "TCP", "DPT": "9100", "DST": "10.x.x.x", "ID": "62910", "IN": "eth1", "LEN": "60", "MAC": "fc:ff:da:47:af:13:b4:2e:99:19:12:00:00:00", "OUT": "", "PREC": "0x00", "RES": "0x00", "SPT": "47468", "SRC": "10.x.x.x", "SYN URGP": "0", "TOS": "0x00", "TTL": "63", "WINDOW": "64240" } |
Beta Was this translation helpful? Give feedback.
parse_key_value
hasaccept_standalone_key
defaulted to true, as well aswhitespace
to "lenient".Playing in the REPL I get this: