Splunk Search

How do I use MV_ADD to split raw strings with pipe separated values into multivalue fields?

gesman
Communicator

I have data like this:

one_field="value_a|value_b|value_c", other_field="value_x|value_y"

How can I instruct MV_ADD to convert fields within such data to multivalue fields including auto-splitting value at '|'?

Tags (3)
0 Karma

gesman
Communicator

Apparently I don't even need MV_ADD, this solution seems to work:

Adding this to ./etc/system/local/fields.conf:

[one_field]
TOKENIZER = ([^\|]+)

[other_field]
TOKENIZER = ([^\|]+)

Ideally though I'd love to limit such transformation to specific sourcetype or index, instead of doing it globally. Not sure it's possible with fields.conf-based solution.

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security 8.0.2 Availability: On cloud and On-premise!

A few months ago, we released Splunk Enterprise Security 8.0 for our cloud customers. Today, we are excited to ...

Logs to Metrics

Logs and Metrics Logs are generally unstructured text or structured events emitted by applications and written ...

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...