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, an upvote 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, an upvote 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, an upvote would be appreciated.

View solution in original post

Manila_Mishra
Explorer

Thanks 😊

0 Karma