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>= \[)"

 


 

Labels (1)
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 the Splunk Community Dashboard Challenge!

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

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...