<?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 Timechart problem in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-problem/m-p/56665#M13882</link>
    <description>&lt;P&gt;Hi:&lt;/P&gt;

&lt;P&gt;I'm new to Splunk and I've been trying to run the following query for a couple of weeks but I only get data for the current date:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="bcoat_proxysg" action!="TCP_HIT" | eval P1=split(proxy_server,"G")|eval GW=mvindex(P1,0)|eval Gateway=if(GW = "xx1","Site1", if(GW="xx2","Site2", GW))|eventstats sum(cs_bytes) as dl by Gateway|timechart count(eval(dl/1048576)) as "Download (MBytes)" by Gateway span=24h&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="bcoat_proxysg" action!="TCP_HIT" | eval P1=split(proxy_server,"G")|eval GW=mvindex(P1,0)|eval Gateway=if(GW = "xx1","DCW", if(GW="xx2","DCE", GW))|eventstats sum(cs_bytes) as dl by Gateway|bucket _time span=24h|convert timeformat="%m/%d/%Y" ctime(_time) AS c_time|chart count(eval(dl/1048576)) as "Download (MBytes)" over c_time by Gateway&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In short, I'm trying to get the downloads (sc_bytes) in Megabytes (the information is provided in bytes) by Gateway per day.&lt;/P&gt;

&lt;P&gt;Can anybody point me to what I am doing wrong?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2012 20:02:43 GMT</pubDate>
    <dc:creator>Kelvin_Perez</dc:creator>
    <dc:date>2012-12-06T20:02:43Z</dc:date>
    <item>
      <title>Timechart problem</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-problem/m-p/56665#M13882</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;

&lt;P&gt;I'm new to Splunk and I've been trying to run the following query for a couple of weeks but I only get data for the current date:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="bcoat_proxysg" action!="TCP_HIT" | eval P1=split(proxy_server,"G")|eval GW=mvindex(P1,0)|eval Gateway=if(GW = "xx1","Site1", if(GW="xx2","Site2", GW))|eventstats sum(cs_bytes) as dl by Gateway|timechart count(eval(dl/1048576)) as "Download (MBytes)" by Gateway span=24h&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="bcoat_proxysg" action!="TCP_HIT" | eval P1=split(proxy_server,"G")|eval GW=mvindex(P1,0)|eval Gateway=if(GW = "xx1","DCW", if(GW="xx2","DCE", GW))|eventstats sum(cs_bytes) as dl by Gateway|bucket _time span=24h|convert timeformat="%m/%d/%Y" ctime(_time) AS c_time|chart count(eval(dl/1048576)) as "Download (MBytes)" over c_time by Gateway&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In short, I'm trying to get the downloads (sc_bytes) in Megabytes (the information is provided in bytes) by Gateway per day.&lt;/P&gt;

&lt;P&gt;Can anybody point me to what I am doing wrong?&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2012 20:02:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-problem/m-p/56665#M13882</guid>
      <dc:creator>Kelvin_Perez</dc:creator>
      <dc:date>2012-12-06T20:02:43Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart problem</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-problem/m-p/56666#M13883</link>
      <description>&lt;P&gt;Firstly, I managed to produce some results with your search, though I had to modify it to work with &lt;CODE&gt;access_combined&lt;/CODE&gt;, (&lt;CODE&gt;bytes&lt;/CODE&gt; instead of &lt;CODE&gt;cs_bytes&lt;/CODE&gt;, &lt;CODE&gt;clientip&lt;/CODE&gt; instead of &lt;CODE&gt;Gateway&lt;/CODE&gt; etc)&lt;/P&gt;

&lt;P&gt;I think you are using &lt;CODE&gt;count&lt;/CODE&gt; in the wrong way, at least if you want to find the amount of data being transferred. Try the &lt;CODE&gt;eval&lt;/CODE&gt; for the bytes -&amp;gt; megabytes first, and make a &lt;CODE&gt;sum&lt;/CODE&gt; in the &lt;CODE&gt;timechart&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="bcoat_proxysg" action!="TCP_HIT" | eval P1=split(proxy_server,"G")|eval GW=mvindex(P1,0)|eval Gateway=if(GW = "xx1","Site1", if(GW="xx2","Site2", GW))| eval MB=cs_bytes/1024/1024| timechart sum(MB) as "Download (MBytes)" by Gateway span=24h
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2012 21:47:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-problem/m-p/56666#M13883</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2012-12-06T21:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart problem</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-problem/m-p/56667#M13884</link>
      <description>&lt;P&gt;Hi Kristian:Thanks a lot for the example! Seems to be working better. However, I'm still getting data only for the current date or the last date in the selected custom range. All other dates return no data.:(&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2012 15:54:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-problem/m-p/56667#M13884</guid>
      <dc:creator>Kelvin_Perez</dc:creator>
      <dc:date>2012-12-07T15:54:01Z</dc:date>
    </item>
  </channel>
</rss>

