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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...