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!

CX Day is Coming!

Customer Experience (CX) Day is on October 7th!! We're so excited to bring back another day full of wonderful ...

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...