Splunk Search

Extract a value from a string?

schu777
Explorer

I'm fairly new to Splunk and I looked at the possible "Questions that may already have your answer?" and didn't find something clear or looked like what I needed.

This is my string that I'm trying to get out of a log from an application:

15-Sep-2015 09:29:22 MyApplication Successful Delivery to Destination XXXXXXX Batch No 459 (DR ID: 194)

The goal is to get a count of these messages for each value in XXXXXXX - so I would then
have something like (of course in a nice graph 🙂
XXXXXX1 : 304
XXXXXX2 : 984
XXXXXX3 : 543

0 Karma

somesoni2
SplunkTrust
SplunkTrust

Try this

your base search | rex "Delivery to Destination (?<Destination>[^\s]+)" | stats count by Destination
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...