<?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 do I create a sparkline for each day in a chart? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208283#M60739</link>
    <description>&lt;P&gt;Try the updated answer.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Dec 2016 19:47:50 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-12-29T19:47:50Z</dc:date>
    <item>
      <title>How do I create a sparkline for each day in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208280#M60736</link>
      <description>&lt;P&gt;I am trying to summarize network traffic to or from an IP address.  I would like to look for daily patterns and thought that a sparkline would help to call those out. I cannot  figure out how to make a sparkline for each day.&lt;/P&gt;

&lt;P&gt;What I have so far:    &lt;/P&gt;

&lt;P&gt;traffic counts to an IP address by the minute:  &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| tstats summariesonly=t count FROM datamodel=Network_Traffic.All_Traffic&lt;BR /&gt;
WHERE All_Traffic.dest_ip=134.170.30.203 &lt;BR /&gt;
BY _time, All_Traffic.src_ip, All_Traffic.dest_ip, All_Traffic.dest_port span=1m&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Which I can summarize over each day with&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| tstats summariesonly=t count FROM datamodel=Network_Traffic.All_Traffic &lt;BR /&gt;
WHERE All_Traffic.dest_ip=134.170.30.203 &lt;BR /&gt;
BY _time, All_Traffic.src_ip, All_Traffic.dest_ip, All_Traffic.dest_port span=1m&lt;BR /&gt;
|timechart sum(count) as Count min(_time) as First max(_time) as Last span=1d &lt;BR /&gt;
| eval First=strftime(First,"%m/%d/%y %H:%M") | eval Last=strftime(Last,"%m/%d/%y %H:%M")&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;The initial span of a minute is just there so that I can get 1 minute resolution to the first and last times of each day.  I actually use an intermediate time chart so that I can save daily fist and last times&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;| tstats summariesonly=t count FROM datamodel=Network_Traffic.All_Traffic &lt;BR /&gt;
WHERE All_Traffic.dest_ip=134.170.30.203 &lt;BR /&gt;
BY _time, All_Traffic.src_ip, All_Traffic.dest_ip, All_Traffic.dest_port span=1m&lt;BR /&gt;
| timechart sum(count) as minCount earliest(_time) as minFirst latest(_time) as minLast span=1m &lt;BR /&gt;
| timechart sum(minCount) as Count min(minFirst) as First max(minLast) as Last span=1d &lt;BR /&gt;
| eval First=strftime(First,"%m/%d/%y %H:%M") | eval Last=strftime(Last,"%m/%d/%y %H:%M")&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;So the above gives me a record for each day with the date, number of network events, first network event, and last network event, looking something like:&lt;BR /&gt;
_time..............Count.....First........................Last&lt;BR /&gt;
2016-12-25....30...........12/25/16 04:25.....12/25/16 23:24&lt;BR /&gt;
2016-12-26....42...........12/26/16 02:18.....12/26/16 09:14&lt;BR /&gt;
2016-12-27....430.........12/27/16 03:51.....12/27/16 20:13&lt;BR /&gt;
2016-12-28....48...........12/28/16 03:51.....12/28/16 10:20&lt;BR /&gt;
2016-12-29....48...........12/29/16 05:27.....12/29/16 08:23&lt;/P&gt;

&lt;P&gt;I would like to add a sparkline indicating how the network events were distributed across the day each day.  Can someone help me figure out how to do this?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:12:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208280#M60736</guid>
      <dc:creator>MonkeyK</dc:creator>
      <dc:date>2020-09-29T12:12:46Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a sparkline for each day in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208281#M60737</link>
      <description>&lt;P&gt;Give this a try&lt;BR /&gt;
&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats summariesonly=t count FROM datamodel=Network_Traffic.All_Traffic 
WHERE All_Traffic.dest_ip=134.170.30.203 
BY _time, All_Traffic.src_ip, All_Traffic.dest_ip, All_Traffic.dest_port span=1m
| timechart sum(count) as minCount earliest(_time) as minFirst latest(_time) as minLast span=1m 
| eval Day=strftime(_time,"%F")
| stats sparkline(sum(minCount),5m) as countTrend sum(minCount) as Count min(minFirst) as First max(minLast) as Last by Day
| eval First=strftime(First,"%m/%d/%y %H:%M") | eval Last=strftime(Last,"%m/%d/%y %H:%M")
| eval _time=strptime(Day,"%F") | table _time countTrend Count First Last
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Dec 2016 19:28:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208281#M60737</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-12-29T19:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a sparkline for each day in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208282#M60738</link>
      <description>&lt;P&gt;I got:&lt;BR /&gt;
Error in 'stats' command: Sparklines not specific to a field must use the "count" aggregator&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2016 19:36:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208282#M60738</guid>
      <dc:creator>MonkeyK</dc:creator>
      <dc:date>2016-12-29T19:36:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a sparkline for each day in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208283#M60739</link>
      <description>&lt;P&gt;Try the updated answer.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2016 19:47:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208283#M60739</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-12-29T19:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a sparkline for each day in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208284#M60740</link>
      <description>&lt;P&gt;Thank you!  That gets me a sparkline.&lt;/P&gt;

&lt;P&gt;Oddly the graph that it creates seems to have no basis in reality.   For example on one of the days, first and last times are 5:30-8:30am, while the sparkline notes all events at the end of the day.&lt;/P&gt;

&lt;P&gt;Are sparklines supposed to actually represent something?&lt;/P&gt;

&lt;P&gt;Also, with your Day eval, I don't need the first timechart.  I swap out minCount for count and use _time instead of minFirst and minLast.  That is pretty neat.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2016 20:39:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208284#M60740</guid>
      <dc:creator>MonkeyK</dc:creator>
      <dc:date>2016-12-29T20:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a sparkline for each day in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208285#M60741</link>
      <description>&lt;P&gt;Actually, I see what has happened.  It looks like the sparkline is taking into account all datapoints from my search even though the row's span is only one day.  So all of the zeros from day one are included in the sparkline for day 2.  Concequently, the second day results start to the right for the first day results , and the third day results to the right of that.&lt;BR /&gt;&lt;BR /&gt;
To make matters worse, it looks like sparklines may have a max number of datapoints that they can represent, when those are exceeded, the rest of the sparkline is truncated and my last day may show no data at all.&lt;/P&gt;

&lt;P&gt;is there a way to make the sparkline only consider the day that the row represents?&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2016 21:58:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208285#M60741</guid>
      <dc:creator>MonkeyK</dc:creator>
      <dc:date>2016-12-29T21:58:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a sparkline for each day in a chart?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208286#M60742</link>
      <description>&lt;P&gt;I am accepting this answer and asking about where the sparkline start in a different question&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/484433/how-do-i-create-daily-sparklines-that-start-with-t.html"&gt;https://answers.splunk.com/answers/484433/how-do-i-create-daily-sparklines-that-start-with-t.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;I think that one indicates that Splunk says there is a limitation in sparklines that prevents them from only showing data relevant to a time span record.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jan 2017 20:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-a-sparkline-for-each-day-in-a-chart/m-p/208286#M60742</guid>
      <dc:creator>MonkeyK</dc:creator>
      <dc:date>2017-01-05T20:56:48Z</dc:date>
    </item>
  </channel>
</rss>

