Splunk Search

extract with quoted values

bowa
Path Finder

In our logs we have keyvalue pairs that looks like this

key1='valuex'
key2='value value val'
keyx=''
keyxx='lksajdf lajsdf'

just the default |extract does a good job but all the values still have the single quotes around them. One thing to remember is that we dont know how many keys and what keys there will be, so i cant hard code them, they are volatile.

i would like to apply this regexp to all the values of my extractions ^'(.*)'$

can i configure this somewhere in my transforms.conf ?

Tags (1)
0 Karma

bojanz
Communicator

Something like this should work:

props.conf:

[mysourcetype]
REPORT-ex = myreport

transforms.conf:

[myreport]
REGEX = ([^=]+)='([^']+)'\s
FORMAT = $1::$2
REPEAT_MATCH = true

This should automatically extract all values and populate keyX fields with them, no matter how many there are.

0 Karma

bowa
Path Finder

doesn't work for me ... just using |extract works but all values are still with the single quotes around them .

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...