Splunk Dev

Formatting outputs of latest events in multiple sourcetypes possible?

rome75
Engager

Hello, I am trying to take a search like this
index=public sourcetype=public1* OR sourcetype=public2* newyork* earliest=60m@m | convert ctime(_time) as time | stats latest(time) by device, sourcetype

device              sourcetype       latest(time)
newyorkdevice1      public1         11/10/2019 00:32:00.000
newyorkdevice1      public2         11/10/2019 00:32:00.000
newyorkdevice2      public1         11/10/2019 00:32:00.000
newyorkdevice2      public2         11/10/2019 00:32:00.000

and get an output like this

device          public1                     public2
newyorkdevice1    11/10/2019 00:32:00.000        11/10/2019 00:32:00.000
newyorkdevice2    11/10/2019 00:32:00.000        11/10/2019 00:32:00.000

Any help or advice is appreciated

Tags (1)
0 Karma
1 Solution

renjith_nair
Legend

@rome75,

Try chart command

index=public sourcetype=public1* OR sourcetype=public2* newyork* earliest=60m@m
|chart latest(_time) as _time over device by network
---
What goes around comes around. If it helps, hit it with Karma 🙂

View solution in original post

0 Karma

renjith_nair
Legend

@rome75,

Try chart command

index=public sourcetype=public1* OR sourcetype=public2* newyork* earliest=60m@m
|chart latest(_time) as _time over device by network
---
What goes around comes around. If it helps, hit it with Karma 🙂
0 Karma

rome75
Engager

Thank you for steering me in the right direction. I used chart and got the output I was looking for.

| convert ctime(_time) as time 
 | chart latest(time)  by device, sourcetype

 device    sourcetype_A        sourcetype_B
 newyorkdevice1    11/10/2019 00:32:00.000        11/10/2019 00:32:00.000
 newyorkdevice2    11/10/2019 00:32:00.000        11/10/2019 00:32:00.000
0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...