<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help with cron time in Alerting</title>
    <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267370#M4919</link>
    <description>&lt;P&gt;Hey vrmandadi, &lt;/P&gt;

&lt;P&gt;I can assure you rich is steering you in the correct direction. I have used timewrap to implement custom machine learning algorithms that compare day over day, week over week, month over month. &lt;/P&gt;

&lt;P&gt;While general use can be a timechart (people like to see their comparisons in timeseries graphs) you are not limited to timecharts, and remember, for every timechart there is a stats table underneath that can power other vizualizations...the viz you need is truly up to you and your data. &lt;/P&gt;

&lt;P&gt;Give it a shot and let us know if you run into issues!&lt;/P&gt;</description>
    <pubDate>Sat, 02 Apr 2016 14:01:06 GMT</pubDate>
    <dc:creator>mattymo</dc:creator>
    <dc:date>2016-04-02T14:01:06Z</dc:date>
    <item>
      <title>Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267362#M4911</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am doing comparison reports , I am trying to calculate three things&lt;/P&gt;

&lt;P&gt;1)compare a particular day in a week with the same day in the previous week&lt;BR /&gt;
  example: monday of each week&lt;/P&gt;

&lt;P&gt;2)compare the data with the present month with the previous three months (total of three months)&lt;BR /&gt;
 example: march to be compared with the addition of december ,january and february&lt;/P&gt;

&lt;P&gt;3) this year with previous year &lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 21:48:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267362#M4911</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2016-03-31T21:48:27Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267363#M4912</link>
      <description>&lt;P&gt;You need help with Cron OR the time-ranges for the search? How frequently you want to run these reports?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 22:03:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267363#M4912</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-03-31T22:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267364#M4913</link>
      <description>&lt;P&gt;I have to create a dashboard which is bar chart ,which  should show the comparison for a particular day this week and compare the same day to the previous week ,similarly for other two also.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 23:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267364#M4913</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2016-03-31T23:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267365#M4914</link>
      <description>&lt;P&gt;I tried something for the month like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=*d* sourcetype="abc" earliest=-3mon@mon latest=@mon| chart count by MESSAGE,date_month
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Mar 2016 23:04:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267365#M4914</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2016-03-31T23:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267366#M4915</link>
      <description>&lt;P&gt;I think you may be best served by the &lt;CODE&gt;timewrap&lt;/CODE&gt; command.&lt;/P&gt;

&lt;P&gt;I was going to write more, but I realized that I think that one tip - plus those links below - may let you figure this out on your own.&lt;/P&gt;

&lt;P&gt;If these are enough, upvote them as appropriate. If not, PLEASE comment back and clarify which/what you need help with and we/I would be happy to provide more specific help!&lt;/P&gt;

&lt;P&gt;The &lt;A href="https://splunkbase.splunk.com/app/1645/#/overview"&gt;link to the timewrap command itself&lt;/A&gt;.  Please download and install - note I have absolutely NO link or relationship with whoever wrote it.  In fact, I only use it once per month.  But by GOSH when I use it, it's PERFECT!&lt;BR /&gt;
The &lt;A href="https://splunkbase.splunk.com/app/1645/#/documentation"&gt;link to the timewrap command's documentation&lt;/A&gt; (which is somewhat short, but still useful)&lt;BR /&gt;
A &lt;A href="https://answers.splunk.com/answers/297910/how-to-compare-data-for-specified-absolute-dates-u.html"&gt;random link to an awesome related answer by the handsome and fetching rich7177&lt;/A&gt; (e.g. "me")&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2016 01:41:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267366#M4915</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-04-01T01:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267367#M4916</link>
      <description>&lt;P&gt;Hello rich7177,&lt;/P&gt;

&lt;P&gt;I have seen your links and read the documentation,but my requirement is a different which is used for comparison,the documentation mostly refers to  a timechart command,but I am trying to build a column chart which gives you the comparison of present month compared to the sum of the previous three months and similarly for monday of a week to monday of previous week&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2016 18:22:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267367#M4916</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2016-04-01T18:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267368#M4917</link>
      <description>&lt;P&gt;does the splunk default time picker has all those?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2016 18:23:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267368#M4917</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2016-04-01T18:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267369#M4918</link>
      <description>&lt;P&gt;If you are comparing equal-sized time frames, timewrap works well.  The three examples I link to may have timechart in them, but they are definitely not &lt;STRONG&gt;about&lt;/STRONG&gt; timechart.  They only use timechart to build some summary information (e.g. your count), but then use timewrap to put that into the shape/format you want.&lt;/P&gt;

&lt;P&gt;Let's use your example of comparing this past Monday with the previous Monday.&lt;/P&gt;

&lt;P&gt;Here's an example from my own system using a count of my WinEventLog:Security logs and using timewrap.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="WinEventLog:Security" earliest=-1w@w 
 | timechart count span=1d 
 | timewrap w 
 | where strftime(_time, "%A") == "Monday"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The first line is just my basic search (which actually goes back more than two weeks because of the timeframe snapping).  I could have done something silly like "sum(EventCode)" if I wanted. Line two tells it to timechart a count of events by increments of one day.  Then timewrap it on weeks, and finally filters to just those events which happened on Monday.  &lt;/P&gt;

&lt;P&gt;This gets me a nice little chart (which probably won't line up, but I'm sure you'll figure it out).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time       latest_week 1week_before
2016-03-28 00:00    48      104
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This search can be altered to do month-by-month, week-by-week or other timeframes.  Give it a try, if you get started on that but can't figure out some details, post what you have and what it gets you and we can probably help you get the rest.&lt;/P&gt;

&lt;P&gt;If you click the "visualization" tab and change it to a column chart, then you'll have a column chart comparing the (in my example) past three Mondays.  The links I provided above show a way to filter out the "middle" week.&lt;/P&gt;

&lt;P&gt;If you instead mean you want a table oriented up/down instead of left/right, you could use &lt;CODE&gt;... | transpose&lt;/CODE&gt; tacked onto the end.  But, I don't recommend that unless you actually NEED that, and if that is the case there's a bit more formatting to probably do to it.  Just ask if that is actually the case.  Please try the others before you go down this route.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Apr 2016 22:16:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267369#M4918</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-04-01T22:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267370#M4919</link>
      <description>&lt;P&gt;Hey vrmandadi, &lt;/P&gt;

&lt;P&gt;I can assure you rich is steering you in the correct direction. I have used timewrap to implement custom machine learning algorithms that compare day over day, week over week, month over month. &lt;/P&gt;

&lt;P&gt;While general use can be a timechart (people like to see their comparisons in timeseries graphs) you are not limited to timecharts, and remember, for every timechart there is a stats table underneath that can power other vizualizations...the viz you need is truly up to you and your data. &lt;/P&gt;

&lt;P&gt;Give it a shot and let us know if you run into issues!&lt;/P&gt;</description>
      <pubDate>Sat, 02 Apr 2016 14:01:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267370#M4919</guid>
      <dc:creator>mattymo</dc:creator>
      <dc:date>2016-04-02T14:01:06Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267371#M4920</link>
      <description>&lt;P&gt;I wanted to show a longer-period one as well, as an example.  You'll have to modify it &lt;EM&gt;slightly&lt;/EM&gt; to fit your data, but it should be pretty easy to get working.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="WinEventLog:Security" earliest=-4w
| timechart count span=1w 
| timewrap w series=short
| eval _time=strftime(_time, "%Y-%m-%d 00:00:00") | eval _time=strptime(_time, "%Y-%m-%d %H:%M:%S")
| stats sum(s*) as s* by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;There is some tomfoolery going on in there, though, caused by timewrap and Daylight Savings time.  I explain below, but that's essentially boilerplate you can paste in on any of them.&lt;/P&gt;

&lt;P&gt;The first line is my base search, this will obviously need changed to YOUR search.&lt;BR /&gt;
Next I timechart it into weekly chunks.  I'm just doing &lt;CODE&gt;count&lt;/CODE&gt; and I'm not using a "by" clause, but you can add those.&lt;BR /&gt;
We timewrap to get it like you want.  &lt;STRONG&gt;Note&lt;/STRONG&gt; this is where DST comes in - timewrap seems to chunk into non-DST-handling pieces, so you'd get TWO rows of results not one (try the search up to this point, leaving off the rest, and you'll see what I mean).&lt;BR /&gt;
To fix the DST-crossover issue, we recalculate _time to be _time without hours using a pair of evals.  Since we're rolling up by weeks, it'll hardly matter if you don't have the hours in your "underlying" events.&lt;BR /&gt;
Then, to actually smash the two rows into one as required, we pipe it through stats (and rename all the &lt;CODE&gt;sum(s3)&lt;/CODE&gt; fields into just &lt;CODE&gt;s3&lt;/CODE&gt;).&lt;/P&gt;

&lt;P&gt;If you want after this, you could always rename things afterwards, too.  &lt;CODE&gt;... | rename s0 as "This Week", s1 as "Previous week"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Please give these a try and let us know how well they work - if they do what you need, great!  If they do not, then give a bit of detail about what they don't quite do and we can help with those, too!&lt;/P&gt;</description>
      <pubDate>Sat, 02 Apr 2016 14:01:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267371#M4920</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-04-02T14:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267372#M4921</link>
      <description>&lt;P&gt;And if you want them all overlayed in a pretty graph...&lt;BR /&gt;
&lt;IMG src="http://i.imgur.com/fnEhBH0.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;Otherwise, you can build a series-based chart, newest on the left.&lt;BR /&gt;
&lt;IMG src="http://i.imgur.com/Kv8hgFX.png" alt="alt text" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 02 Apr 2016 15:10:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267372#M4921</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-04-02T15:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Help with cron time</title>
      <link>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267373#M4922</link>
      <description>&lt;P&gt;Thanks a lot and really appreciate your patience and effort ,but we dont use timewrap app&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 20:25:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Alerting/Help-with-cron-time/m-p/267373#M4922</guid>
      <dc:creator>vrmandadi</dc:creator>
      <dc:date>2016-04-04T20:25:20Z</dc:date>
    </item>
  </channel>
</rss>

