Splunk Search

How to plot a graph with field having duplicate values

shashank_24
Path Finder

Hi, I have a scenario where I receive multiple requests which contain same field value basically OrderNumber. So the backend is receiving duplicate orders from the front end.

It only happens every now and then and I'd like to plot a graph which can show me when exactly it happens. I think just the count of duplicates vs _time would be enough.

I've tried using a query but it's giving me a distorted graph. Is there a better way to achieve this?

Query I have - 

index=myapp OrderService "HttpMethod=POST" 
| rex field=_raw "orderNumber\"\:\s\"(?<orderNumber>[^\"]+)" 
| bin span=15m _time 
| stats count by _time orderNumber 
| where count > 1
| table _time count

Let me know if anyone has any suggestions to do this in a better way.

Labels (4)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

What do you mean by "a distorted graph"?  Try removing the the table command as it is dropping a field that may be needed for the graph..

---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...

Spotting Financial Fraud in the Haystack: A Guide to Behavioral Analytics with Splunk

In today's digital financial ecosystem, security teams face an unprecedented challenge. The sheer volume of ...

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability

Solve Problems Faster with New, Smarter AI and Integrations in Splunk Observability As businesses scale ...