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
Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...