Splunk Search

search command "bucket" time sorting

khyoung7410
Communicator

Hi


search command "bucket" time sorting?


My search commmand


* | bucket _time span=1d | eval time=strftime(_time,"%y. %m. %d") | stats ~ | sort -time

  • search result

    (year.month.day)

    => 11.12.11 - - - - - - - - - - - -

    => 11.12.12 - - - - - - - - - - - -

    => 11.12.13 - - - - - - - - - - - -

    => 11.12.14 - - - - - - - - - - - -

    . - - - - - - - - - - - -

    . - - - - - - - - - - - -

But I want search result is


(year.month.day)


=> 11.12.16 - - - - - - - - - - - -


=> 11.12.15 - - - - - - - - - - - -


=> 11.12.14 - - - - - - - - - - - -

Please answer.

thanks

Tags (3)
0 Karma

Ayn
Legend

I don't see what you're doing in the stats command? Anyway, you will probably want to put the eval after you created the stats.

* | bucket _time span=1d | stats count by _time | eval time=strftime(_time,"%y. %m. %d") | sort -_time | table time count
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 ...