Splunk Search

Return string and number before and after equals sign

soumyajk
Engager

Hi,

I am new in splunk and i want to save the value in fields before and after =

for example events look like below
rollnumber=34556
class=12

I want to return rollnumber and class in first field and the number after = in second field.

base search | rex max_match=15 field=_raw "(?P)="

this doesnt work, both values are coming as space.

0 Karma
1 Solution

damien_chillet
Builder

Your regex seems to be incomplete, could you try:

| rex max_match=15 field=_raw "(?P<field1>\w+)\=(?P<field2>\w+)" 

View solution in original post

damien_chillet
Builder

Your regex seems to be incomplete, could you try:

| rex max_match=15 field=_raw "(?P<field1>\w+)\=(?P<field2>\w+)" 
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...