Splunk Search

Display multiple events by dates in table format

ezpc98
New Member

Hi,

Our systems have multiple order records as XML transactions and each order can have multiple events on different dates. I want to search for orders that have had specific event codes and display a table to show the dates when each event code happened for that individual order.

Index name is "xmlogs". Each XML has 'order ref', 'event date' and 'event code'. My search needs to be limited to event_code of 1001 or 1002 or 1003.

Input XML looks like:

<orderref>123456</order_ref>

<evendate>2021-10-01T10:31:13</eventdate>

<eventcode>1001</eventcode>

Similar XML will be for event 1002 etc.

I want output to look like:

orderref100110021003
12345601/10/2021 04/10/2021
78912305/10/202108/10/202113/10/2021

 

Any help will be much appreciated.

Labels (1)
0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Assuming you have already extracted the fields

| where eventcode=1001 OR eventcode=1002 OR eventcode=1003
| xyseries orderref eventcode eventdate
0 Karma
Get Updates on the Splunk Community!

Index This | I’m short for "configuration file.” What am I?

May 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with a Special ...

New Articles from Academic Learning Partners, Help Expand Lantern’s Use Case Library, ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Your Guide to SPL2 at .conf24!

So, you’re headed to .conf24? You’re in for a good time. Las Vegas weather is just *chef’s kiss* beautiful in ...