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

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

Monitoring AI Agents with Splunk Observability Cloud

Let’s say I’m running a travel planning AI app in production. A user asks for three concise hotel options in ...

[Puzzles] Solve, Learn, Repeat: Tiling

This puzzle (first published here) is based on finding groups of tessellated tiles (inspired by floor tiles I ...

SOK it to Me: Top 3 Benefits of Using Splunk Operator on Kubernetes that’ll Make ...

    Thursday, July 9, 2026  |  11:00AM–12:00PM PDT Duration: 1 hour (includes Q&A) Managing can feel like a ...