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!

Quantify Your Splunk Investment Impact: Introducing Savings Metrics to Value Insights

Building on the foundation established in our initial Value Insights releases, we are introducing the Savings ...

Event Series: Telemetry Pipeline Management

Balancing Scale and Spend: Gaining Control Over High-Volume Metrics in Splunk Observability Cloud As ...

Kick the Tires Before You Commit: A Hands-On Tour of the Splunk Observability Cloud ...

Evaluating an enterprise observability platform usually goes like this: fill out a form, get a free trial with ...