Splunk Search

How do I get specific words within a text?

shtom
New Member

The below table is what I get from a search on Splunk"

ActiveLoadId
Jabber_for_iOS-12.1.2.270036
Jabber_for_iOS-12.0.1.263155
Jabber_for_Android-12.5.1.276987
Jabber_for_Windows-11.9.3.60004
Jabber_for_Windows-12.5.0.22884

But what i want is to modify the output text under Field "ActiveLoadID" to see the first few characters. Example below:

ActiveLoadId
Jabber_for_iOS
Jabber_for_iOS
Jabber_for_Android
Jabber_for_Windows
Jabber_for_Windows

My current query is:

 "ActiveLoadId=Jabber_for" | rare limit=20000 ActiveLoadId

Appreciate your help!

0 Karma
1 Solution

vnravikumar
Champion

Hi @shtom

Try

your query....|rex field=ActiveLoadId "(?P<ActiveLoadId>.*)-"

View solution in original post

0 Karma

vnravikumar
Champion

Hi @shtom

Try

your query....|rex field=ActiveLoadId "(?P<ActiveLoadId>.*)-"
0 Karma

shtom
New Member

beautiful.....it worked

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!

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

Ready to make your IT operations smarter and more efficient? Discover how to automate Splunk alerts with Red ...