Splunk Search

How do I automatically run mvexpand on a field?

daniel333
Builder

All,

I run this search -

index=main  | makemv PCIDSS delim=","

I'd like to be automatically expanded instead. But I don't see how I would do this in props.conf

0 Karma
1 Solution

lguinn2
Legend

For a multi-valued field extraction, you must use transforms.conf in conjunction with props.conf.
Since you are not showing us how you got the PCIDSS field to begin with, I can't show exactly how this should be set up. But in addition to any other field extractions you may have, you should do this in props.conf

[yoursourcetypehere]
#other field extractions
REPORT-ep = extract-PCIDSS

in transforms.conf

[extract-PCIDSS]
REGEX = <regular expression>
MV_ADD = true
# and other settings...

You should look at the documentation for transforms.conf. Depending on your actual data, there could be many ways to accomplish what you want. For example there is a way to Configure multivalue fields with fields.conf - although I have not done it that way myself.

View solution in original post

0 Karma

lguinn2
Legend

For a multi-valued field extraction, you must use transforms.conf in conjunction with props.conf.
Since you are not showing us how you got the PCIDSS field to begin with, I can't show exactly how this should be set up. But in addition to any other field extractions you may have, you should do this in props.conf

[yoursourcetypehere]
#other field extractions
REPORT-ep = extract-PCIDSS

in transforms.conf

[extract-PCIDSS]
REGEX = <regular expression>
MV_ADD = true
# and other settings...

You should look at the documentation for transforms.conf. Depending on your actual data, there could be many ways to accomplish what you want. For example there is a way to Configure multivalue fields with fields.conf - although I have not done it that way myself.

0 Karma

daniel333
Builder

Thanks @lguinn

I guess I am not understanding why I would need to do a regex. I don't see how I specify the delimited here.

So it's probably worth mentioning that the field PCIDSS is just appended at search time for documentation purposes.

props.conf

EVAL-PCIDSS = "11.1.a,11.1.b,11.1.c,11.1.d,11.1.1,11.1.2.a,11.1.2.b"

I tried this a few ways

[extract-PCIDSS]
SOURCE_KEY = PCIDSS
MV_ADD = true

[extract-PCIDSS]
SOURCE_KEY = PCIDSS
MV_ADD = true
regex = .*

[extract-PCIDSS]
SOURCE_KEY = PCIDSS
MV_ADD = true
regex= PCIDSS=(?

0 Karma

daniel333
Builder

Good call on the fields.conf method, worked like a charm

[PCIDSS]
TOKENIZER = ([^\,]+)

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...