Splunk Search

How to fetch report from different timestamp(asynchoronus journey)from unique id?

Shobhitha1
New Member

Hello Everyone,

I have a requirement where I have to generate a query. 

event 1 : <l:event dateTime="2023-02-10 11:28:49.299"......some ******data*****<ns2:orderNumber>111040481</ns2:orderNumber>*****some****data****<ns2:customerType>B2C</ns2:customerType>

 

event 2 : event dateTime="2023-02-15 11:28:49.299"......some ******data*****<ns2:orderNumber>111040481</ns2:orderNumber>*****some****data****

 

I have to fetch OrderNumber from event2, and  CustomerType from event1... As ordernumber is unique.. Since event1 and event2 are on different date, can we write a query to get a report ?

Labels (1)
Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Assuming the fields are extracted already, use the stats command to group events by orderNumber.

| stats values(*) as * by orderNumber

 

---
If this reply helps you, Karma would be appreciated.
0 Karma

Shobhitha1
New Member

Hi.. Thank you for responding.. 

But my query is how will i keep the time range.. because event 2 can come on any date.. how to generate report out of it.. My report should look like 

Order NumberCustomer TypeDate
   
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The stats command I gave groups events by orderNumber and preserves the other fields.  After that you can use other SPL reporting commands to get the output you want.

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

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...