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!

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...