Splunk Enterprise

What rex command extracts data from csv?

Ashwini008
Builder

Hi,

I am trying to extract data from one of the column in lookup file. Regex expression is working in rex tool. I want to use that regex expression in rex command in splunk .

Rexgex expression  ^.*(?= \[)

Example: Want to extract the highlighted bold data. This data is present in csv lookup file.

  1. TAX PLATFORM [12998]
  2. CPOI [0639]

 

| inputlookup Meta.csv 
| rex field=Application "^.*(?<name>= \[)"

 


 

Tags (3)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Sorry, I left the '=' in unnecessarily - try this

| inputlookup Meta.csv 
| rex field=Application "^(?<name>.*) \["

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust
| inputlookup Meta.csv 
| rex field=Application "^(?<name>.*)= \["
0 Karma

Ashwini008
Builder

@ITWhisperer It isn't working

Ashwini008_0-1679654470813.png

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Sorry, I left the '=' in unnecessarily - try this

| inputlookup Meta.csv 
| rex field=Application "^(?<name>.*) \["
0 Karma
Get Updates on the Splunk Community!

Introducing a Smarter Way to Discover Apps on Splunkbase

We’re excited to announce the launch of a foundational enhancement to Splunkbase: App Tiering. Because we’ve ...

How to Send Splunk Observability Alerts to Webex teams in Minutes

As a Developer Evangelist at Splunk, my team and I are constantly tinkering with technology to explore its ...

.conf25 Registration is OPEN!

Ready. Set. Splunk! Your favorite Splunk user event is back and better than ever. Get ready for more technical ...