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!

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...

Cloud Monitoring Console - Unlocking Greater Visibility in SVC Usage Reporting

For Splunk Cloud customers, understanding and optimizing Splunk Virtual Compute (SVC) usage and resource ...

Automatic Discovery Part 3: Practical Use Cases

If you’ve enabled Automatic Discovery in your install of the Splunk Distribution of the OpenTelemetry ...