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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...