Splunk Search

How can I extract data with delimiter?

yk010123
Path Finder

I have a log entry with the current format: 

 

field=A_B

 

(delimited by underscore)

How can I extract this data into two different fields so that I can create a table 

field1field2
AB
Labels (2)
0 Karma
1 Solution

bowesmana
SplunkTrust
SplunkTrust

If your field is called 'field' then this

| rex field=field "(?<field1>[^_]*)_(?<field2>.*)"

will create new fields 'field1' and 'field2' 

View solution in original post

bowesmana
SplunkTrust
SplunkTrust

If your field is called 'field' then this

| rex field=field "(?<field1>[^_]*)_(?<field2>.*)"

will create new fields 'field1' and 'field2' 

Get Updates on the Splunk Community!

Demo Day: Strengthen Your SOC with Splunk Enterprise Security 8.1

Today’s threat landscape is more complex than ever. Security operation centers (SOCs) are overwhelmed with ...

Dashboards: Hiding charts while search is being executed and other uses for tokens

There are a couple of features of SimpleXML / Classic dashboards that can be used to enhance the user ...

Splunk Observability Cloud's AI Assistant in Action Series: Explaining Metrics and ...

This is the fourth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how ...