Splunk Search

Field Extraction - Multiple Matches same line

BP9906
Builder

Hello,
How can I make a field extraction match multiple times on a given line?

here's an example:

datetime=1355871514&reason_code=reason1&reason_code=reason2&id=123456

I'd like the field to show "reason_code" = "reason1" and "reason2".

Thanks,
Brian

Tags (1)
0 Karma

BP9906
Builder

BP9906
Builder

Right now, this does not match both, only the first match.

(?i)&reason_code=(?P[^&]+)

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Automating Threat Operations and Threat Hunting with Recorded Future

APP DEVELOPER TECH TALK Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 ...

Keep the Learning Going with the New Best of .conf Hub

Hello Splunkers, With .conf26 getting closer, there’s already a lot of excitement building around this year’s ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...