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!

Laser Bananas and Edge Hubs: Exploring Operational Technology (OT) Data Through a ...

  OT is a different environment to traditional IT and can have interesting challenges when interfacing the ...

Event Series: Mastering AI Tokenomics and Splunk Agent Observability

Beyond the Black Box: Correlating AI Performance and Tokenomics with Splunk Agent Observability   As ...

span_metrics: The OpenTelemetry-Idiomatic Way to See Inside Your Services

You open a trace in Splunk Observability Cloud and everything looks fine. One root span, order-pipeline, with ...