Splunk Search

extract valued of a field

mmengu416
New Member

Hi,
we have client_id=tom. client_id=thomas, client_id=Jack, client_id=tom-new, client_id=tom_old.. so on like 100s of them. for a particular query such as
index=aaa sourcetype=bbb search "my string" | stats count by client_id
I want to extract value for the field "client_id", when I try to use the "extract field" in Splunk it is picking up different values which are not the actual client_id values.
how do I write regex/rex to entract "client_id"
query to look for the "client_id" filed and display its value.

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You shouldn't need to use the field extractor for key=value fields as Splunk extracts them automatically.
Can you share some actual (sanitized) events?

---
If this reply helps you, Karma would be appreciated.
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @mmengu416,
if in your logs you have client_id=tom, Splunk recognize that client_id is a field and associate tom to this field, if otherwise you have a different format (e.g. client_id: tom), you have to extract this field using regex
could you share an example of your logs?

Ciao.
Giuseppe

0 Karma
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, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

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 ...