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
Revered Legend

Try this

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

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...