<?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: How to compare data from the same month for multiple years? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289981#M87694</link>
    <description>&lt;P&gt;@joseph.hazlett - sorry, that should be &lt;CODE&gt;|head 5&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 09 Oct 2017 22:51:43 GMT</pubDate>
    <dc:creator>DalJeanis</dc:creator>
    <dc:date>2017-10-09T22:51:43Z</dc:date>
    <item>
      <title>How to compare data from the same month for multiple years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289977#M87690</link>
      <description>&lt;P&gt;I am doing a very basic search that just shows the top URIs during a specific month each year. I would like to be able to put multiple years within the same graph to do a quick visual comparison. My search is as follows:&lt;/P&gt;

&lt;P&gt;source="/opt/gathered-logs/*/apache2/access_log" | stats count by uri&lt;/P&gt;

&lt;P&gt;And I define the date range for the search (November 2015/16/17/etc.) I get the information I want from the graph in a pie graph, but it's not very helpful for comparison purposes. I'd like to just show an overall line graph that displays Nov. 2015 vs Nov. 2016 on the same graph. I don't really need to know individual stats per URI, so if I remove the |stats count by uri, I get the nice general green bar graph in splunk, but I don't see a way to define two different date ranges and overlay them or whatever. Is this possible?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 17:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289977#M87690</guid>
      <dc:creator>joseph_hazlett</dc:creator>
      <dc:date>2017-10-06T17:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare data from the same month for multiple years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289978#M87691</link>
      <description>&lt;P&gt;what about&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="/opt/gathered-logs/*/apache2/access_log"|timechart span=1mon count|timewrap 1mon
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Oct 2017 17:53:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289978#M87691</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-10-06T17:53:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare data from the same month for multiple years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289979#M87692</link>
      <description>&lt;P&gt;Try this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; source="/opt/gathered-logs/*/apache2/access_log" 
| eval Month=strftime(_time,"%Y-%m-%d")
| where substr(Month,6,2)="11"
| stats count as mycount by Month uri
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;... now you have all the info for each November (Month=11).  &lt;/P&gt;

&lt;P&gt;Let's take the traffic for the top 5 uris THIS year, and check the trend for those for prior years...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| appendpipe [| sort 0 - Month - mycount | head 5 | table uri | eval myflag="keepme"]
| eventstats values(myflag) as myflag by uri
| where myflag="keepme" AND isnotnull(mycount)
| eval _time = strptime(Month,"%Y-%m-%d") 
| timechart sum(mycount) by uri
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;updated - changed &lt;CODE&gt;top 5&lt;/CODE&gt; to &lt;CODE&gt;head 5&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 20:50:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289979#M87692</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-06T20:50:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare data from the same month for multiple years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289980#M87693</link>
      <description>&lt;P&gt;This almost seems to work. I had to add "uri" after "top 5" for it to not error out. I just realized I haven't been collecting these Apache logs for more than a year, so I can't even test to see if this is fully functional until November rolls around. Thank you DalJeanis, I'm going to save this as a report and see what happens after our busy November ends. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2017 22:05:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289980#M87693</guid>
      <dc:creator>joseph_hazlett</dc:creator>
      <dc:date>2017-10-06T22:05:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare data from the same month for multiple years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289981#M87694</link>
      <description>&lt;P&gt;@joseph.hazlett - sorry, that should be &lt;CODE&gt;|head 5&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 22:51:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289981#M87694</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-10-09T22:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare data from the same month for multiple years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289982#M87695</link>
      <description>&lt;P&gt;Thanks. I've updated the report and hopefully will see results next month. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Oct 2017 23:00:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289982#M87695</guid>
      <dc:creator>joseph_hazlett</dc:creator>
      <dc:date>2017-10-09T23:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare data from the same month for multiple years?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289983#M87696</link>
      <description>&lt;P&gt;has this worked for you? I am also looking for the same. Please let me know. &lt;/P&gt;</description>
      <pubDate>Thu, 10 Jan 2019 10:22:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-compare-data-from-the-same-month-for-multiple-years/m-p/289983#M87696</guid>
      <dc:creator>abhijitsaoji</dc:creator>
      <dc:date>2019-01-10T10:22:49Z</dc:date>
    </item>
  </channel>
</rss>

