Splunk Search

Extract an value from logged sentence

j3r0n
Explorer

Hi,
I'm trying to make a Splunk panel display a value from a log that gets added to every 4 minutes.
I need to be able to see on the dashboard if the value suddenly drops.
I've tried extracting the value, but it keeps messing up.
Should I use regex, or do I need to extract it in a different way?
My goal is to only get the value after "value= " to return.

This is how the data looks when it's imported into Splunk, each new line is a single event:

2020-05-14T13:39:28.423Z, machine= wefqwr2312, value= 14
2020-05-14T13:40:29.003Z, machine= wefqwr2312, value= 14
2020-05-14T13:40:29.118Z, machine= wefqwr2312, value= 14
2020-05-14T13:41:28.316Z, machine= wefqwr2312, value= 14
2020-05-14T13:41:28.323Z, machine= wefqwr2312, value= 14
2020-05-14T13:45:48.032Z, machine= wefqwr2312, value= 14
2020-05-14T13:45:48.041Z, machine= wefqwr2312, value= 14

Thanks!

0 Karma
1 Solution

skoelpin
SplunkTrust
SplunkTrust

Add this to your SPL and replace FIELD_NAME with your actual field name. I'd recommend fixing the logging to remove that space after value so Splunk can create the key value pair automatically without manually extracting

| rex value\=\s(?<FIELD_NAME>/d+)

View solution in original post

skoelpin
SplunkTrust
SplunkTrust

Add this to your SPL and replace FIELD_NAME with your actual field name. I'd recommend fixing the logging to remove that space after value so Splunk can create the key value pair automatically without manually extracting

| rex value\=\s(?<FIELD_NAME>/d+)

j3r0n
Explorer

Thanks alot for your reply!
I've edited the logging now, without the space after value.
Do I need a different rex now? And the extracted field of which I put the name in the regex, only has to be the "16" instead of "value=16" right?

skoelpin
SplunkTrust
SplunkTrust

Nothing further needed! Splunk will identify key value pairs automatically and extract them out for you. Splunk looks for common delimiters such as the : or = and identifies everything on the left side as the field and everything on the right side as the value. Keep it in the format of value=14

Once it has a little run time, go look at your fields on the left and find the field value to verify it extracts properly

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...