Splunk Search

How do I parse a text line and grab only 1 value

zkxi98m
New Member

New to splunk so don't laugh too much at this -

I have many strings that look similiar to this:

[71] 20130226.015959.650 3512.380251 RESULT success 0 entries 1 msecs

I want to be able to grab the msecs number and graph the avg per minute. I tried this:

index=blah blah blah |regex _raw="entries (?P\d+) msecs" | timechart span=1m avg(msecs)

Obviously that doesn't give me what I want. Any assistance would be most appreciated.

Tags (2)
0 Karma

Rob
Splunk Employee
Splunk Employee

Hi,

Give this a shot:

index=blah blah blah |rex field=_raw "entries (?<msecs>\d+) msecs" | timechart span=1m avg(msecs)

The regex command is for filtering results and the rex command is used for extracting values. Take a look at both commands in the docs for more info on syntax and usage.

0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...