All Apps and Add-ons

Split raw string by a separator

ifbeli
New Member

Hi,

Basically I have a raw string, part of huge csv file.

Additional Role Service Line: None
Comments / Additional information:
ACTION: *** New Starter - Add Role(s) ***";"whatever info
Email Address: some_email
First Name: name

I wanna extract everything after 'Comments'. I came up with the below 2 queries, but none of them is working. I know it might be a basic query, but I am new to Splunk.

index=test_regular_expression source="report_test_data.csv"  | fields Description | eval tmp_result=split(Description, "Comments") | eval result=mvindex(tmp_result,0) | fields + result 

index=test_regular_expression source="report_test_data.csv" | fields Description | makemv delim="Comments" Description allowempty=false

Ignore the index name, the csv file column is called 'Description'.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Perhaps this will get you going in the right direction.

index=test_regular_expression source="report_test_data.csv"  | rex field=Description "Comments(?<Comments>.*)" | ...
---
If this reply helps you, Karma would be appreciated.
0 Karma

somesoni2
SplunkTrust
SplunkTrust

Try this

index=test_regular_expression source="report_test_data.csv"  | fields Description  | rex field=Description "Comments(?<Comments>.+)"
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...