Skip to content

Instantly share code, notes, and snippets.

@wshihadeh
Created July 11, 2020 11:42
Show Gist options
  • Save wshihadeh/0e1221ce5286cfb39eaf23a4671369c2 to your computer and use it in GitHub Desktop.
Save wshihadeh/0e1221ce5286cfb39eaf23a4671369c2 to your computer and use it in GitHub Desktop.
<match pattern>
@type key_value_parser
key log
remove_key true
remove_prefix /^[^ ]+\s[^ ]+/
use_regex true
filtered_keys key,gkey
</match>
# Input Data
{
'time' => '2013-02-12 22:01:15 UTC',
'log' => "Start Request sub_key=0 sub_akey=11 sub_zkey=12 key=10 gkey=100 nkey=108 skey='this is a miltispace line' akey=20 zkey=30 dkey=4"
}
# Output Data
{
"time"=>"2013-02-12 22:01:15 UTC",
"gkey"=>"100",
"key"=>"10"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment