Dashboards & Visualizations

Dashboard query

Manila_Mishra
Explorer

I am a beginner at Splunk and I am stuck in a case. How can I get the User-agent from the Request Heder field in Splunk? I mean to ask what query should I write for this??

Labels (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Given those examples, the rex command can do the job.

... | rex field=httpMessage.requestHeaders "User-Agent:\s(?<user_agent>\S+)"
...
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

More details, please.  What problem are you trying to solve?  What queries have you tried so far?  Are you looking for the user-agent string from one of your Splunk indexes or from a Splunk user.  If the latter, then there is no query for it.

Is your web server sending user-agent strings to Splunk for indexing?  If not then no query will find them and you should work on getting that data indexed.  If it is indexed then you should be able to search for it, assuming your role has access to the proper index.  Again, we'll need more information to be more helpful.

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

Manila_Mishra
Explorer

Hi @richgalloway ,

 

Thanks for the reply, I want to understand what Splunk query should I write to extract UserAgent information from the Request Headers.

I have attached an ss below and want to get the highlighted values.

Manila_Mishra_0-1618857839726.png

Please let me know if any other way I should ask my question. 🙂

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Given those examples, the rex command can do the job.

... | rex field=httpMessage.requestHeaders "User-Agent:\s(?<user_agent>\S+)"
...
---
If this reply helps you, Karma would be appreciated.

Manila_Mishra
Explorer

Thanks 😊

0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...