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!

What the End of Support for Splunk Add-on Builder Means for You

Hello Splunk Community! We want to share an important update regarding the future of the Splunk Add-on Builder ...

Solve, Learn, Repeat: New Puzzle Channel Now Live

Welcome to the Splunk Puzzle PlaygroundIf you are anything like me, you love to solve problems, and what ...

Building Reliable Asset and Identity Frameworks in Splunk ES

 Accurate asset and identity resolution is the backbone of security operations. Without it, alerts are ...