Splunk Search

How do I extract a new field from a table?

vinoth12
New Member

Hi, I extracted a field and am viewing it in a table. But some data has a comma (,) in between. I want to create a new column without the comma ** and whatever comes **after the comma should not be there in that field.

please help me to come up with a solution!

Tags (2)
0 Karma
1 Solution

woodcock
Esteemed Legend

Add this to your existing search:

... | rex field=YourExistingFieldName "^(?<YourNewFieldName>[^#]+)"

View solution in original post

0 Karma

woodcock
Esteemed Legend

Add this to your existing search:

... | rex field=YourExistingFieldName "^(?<YourNewFieldName>[^#]+)"
0 Karma

vinoth12
New Member

Hi woodcock,
I want it should get split only alphabets followed by a #, if a space is followed by a #. then i don't want to. can you please help me to do it

0 Karma

woodcock
Esteemed Legend

Like this:
... | rex field=YourExistingFieldName "^(?[^#\s]+)"

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...