All Apps and Add-ons

Timewrap: How to reverse results to show oldest to newest from left to right, not right to left?

HattrickNZ
Motivator

Timewrap is reading oldest to newest from right to left. I want it to be the opposite newest to oldest from left to right.

The pic below shows that may 7th is the oldest but it is showing on the right and aug 13(yesterday) on the left.

<a href="http://tinypic.com?ref=11vk4mr" target="_blank"><img src="http://i58.tinypic.com/11vk4mr.jpg" border="0" alt="Image and video hosting by TinyPic"></a>

In case the pic is not showing above here it is again: alt text

this gives an idea of my search:

index=core ... earliest=-100d@d latest=+d@d | timechart span=d sum(c140509343) as "Incoming downlink user traffic in KB (SGSN/SGW PLMN)"  | eval wday = strftime(_time, "%a") | where wday = "Thu" |  fields - wday | timewrap d series=exact

Is there a way I can somehow reverse this?

Tags (1)
0 Karma
1 Solution

somesoni2
Revered Legend

If you're OK to change the format of date that being displayed on the series from aug07 to 08-07, this should do the trick.

index=core ... earliest=-100d@d latest=+d@d | timechart span=d sum(c140509343) as "Incoming downlink user traffic in KB (SGSN/SGW PLMN)"  | eval wday = strftime(_time, "%a") | where wday = "Thu" |  fields - wday | timewrap d series=exact | untable _time series value | eval series=mvindex(split(series,"_"),0)."_".strftime(strptime(mvindex(split(series,"_"),1),"%b%d"),"%m-%d") | chart values(value) over _time by series

View solution in original post

somesoni2
Revered Legend

If you're OK to change the format of date that being displayed on the series from aug07 to 08-07, this should do the trick.

index=core ... earliest=-100d@d latest=+d@d | timechart span=d sum(c140509343) as "Incoming downlink user traffic in KB (SGSN/SGW PLMN)"  | eval wday = strftime(_time, "%a") | where wday = "Thu" |  fields - wday | timewrap d series=exact | untable _time series value | eval series=mvindex(split(series,"_"),0)."_".strftime(strptime(mvindex(split(series,"_"),1),"%b%d"),"%m-%d") | chart values(value) over _time by series

martin_mueller
SplunkTrust
SplunkTrust

You can include the year to be less American and more ISO 8601: 2015-08-07
As another upside, this will maintain ordering in a few months when we roll over back to January.

0 Karma

HattrickNZ
Motivator

that works tks. although I am not a big fan of the american date format MM-dd 🙂
Also it does some grouping but I can use limit=0 as a paramter to chart to get around this. tvm

Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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