<?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: Timechart - Count columns per day in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114776#M30383</link>
    <description>&lt;P&gt;That's correct.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jan 2014 09:44:22 GMT</pubDate>
    <dc:creator>fbl_itcs</dc:creator>
    <dc:date>2014-01-16T09:44:22Z</dc:date>
    <item>
      <title>Timechart - Count columns per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114771#M30378</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm doing a simple timechart search:&lt;/P&gt;

&lt;P&gt;index=XXX | timechart span=1d count by src_ip&lt;/P&gt;

&lt;P&gt;This leads to a table/chart like this:&lt;/P&gt;

&lt;P&gt;_time  10.10.0.1  10.10.0.2  192.168.2.1&lt;BR /&gt;
01.01.     0              0              3&lt;BR /&gt;
02.01.     1              4              0&lt;BR /&gt;
...&lt;/P&gt;

&lt;P&gt;What I need is a field/column for how many different src_ip there were at each day (so at the first row it would be 1, at the second 2). The problem is I don't know how to use eval in this case because the field names (= column header names) are not known to me --&amp;gt; It could be any IP address.&lt;/P&gt;

&lt;P&gt;Any ideas?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Felix&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 09:29:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114771#M30378</guid>
      <dc:creator>fbl_itcs</dc:creator>
      <dc:date>2014-01-15T09:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Count columns per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114772#M30379</link>
      <description>&lt;P&gt;Hi Felix, &lt;/P&gt;&lt;P&gt; you can try &lt;/P&gt;&lt;P&gt;index=XXX | timechart span=1d dc(src_ip) as diff_src_ip&lt;/P&gt;Bye&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jan 2014 14:29:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114772#M30379</guid>
      <dc:creator>my_splunk</dc:creator>
      <dc:date>2014-01-15T14:29:46Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Count columns per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114773#M30380</link>
      <description>&lt;P&gt;I don't see how I could use this to put the diff_src_ip into the same command. It works by it's own (which I would be able to do by myself ;)) but it doesn't help me with my problem.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:40:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114773#M30380</guid>
      <dc:creator>fbl_itcs</dc:creator>
      <dc:date>2020-09-28T15:40:05Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Count columns per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114774#M30381</link>
      <description>&lt;P&gt;ok, so  you desire to have as results of your search this&lt;BR /&gt;
time  10.10.0.1        10.10.0.2  192.168.2.1   diff_src_ip&lt;BR /&gt;
01.01.     0              0              3          1&lt;BR /&gt;
02.01.     1              4              0          2&lt;/P&gt;

&lt;P&gt;It is all rigth?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:40:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114774#M30381</guid>
      <dc:creator>my_splunk</dc:creator>
      <dc:date>2020-09-28T15:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Count columns per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114775#M30382</link>
      <description>&lt;P&gt;I had a look at this and it's surprisingly tricky (to me at least). The problem is that you can't mix stats calculated by some field with stats calculated over the entire set - once you've specified a split-by clause in your stats command, ALL stats will be calculated by that way.&lt;/P&gt;

&lt;P&gt;The only solution I've come up with is running one stats command for generating a column containing the unique IP count for each timespan, and then use appendcols for adding the individual columns for each IP. This is pretty slow and resource intensive because appendcols needs to run its own subsearch, so you have to run the same base query twice. I'd be happy if someone could find a better solution, but for what it's worth, here is mine:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=XXX | timechart span=1d dc(src_ip) | appendcols [search index=XXX | timechart span=1d count by src_ip | fields - _time]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Jan 2014 09:40:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114775#M30382</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-01-16T09:40:24Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Count columns per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114776#M30383</link>
      <description>&lt;P&gt;That's correct.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2014 09:44:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114776#M30383</guid>
      <dc:creator>fbl_itcs</dc:creator>
      <dc:date>2014-01-16T09:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Count columns per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114777#M30384</link>
      <description>&lt;P&gt;This definitely works. It is kind of slow but as a start a good solution. Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2014 10:23:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114777#M30384</guid>
      <dc:creator>fbl_itcs</dc:creator>
      <dc:date>2014-01-16T10:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Count columns per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114778#M30385</link>
      <description>&lt;P&gt;Felix, did you ever get this figured out? If so, what was the solution?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2014 13:48:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114778#M30385</guid>
      <dc:creator>ryanmims</dc:creator>
      <dc:date>2014-03-04T13:48:20Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - Count columns per day</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114779#M30386</link>
      <description>&lt;P&gt;Hi, I used the solution from Ayn, that looks like:&lt;/P&gt;

&lt;P&gt;index=abc sourcetype=xxx_log | timechart span=1d dc(src_ip) as sources | appendcols [search index=abc sourcetype=xxx_log | timechart span=1d count by src_ip | fields - _time]&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:06:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-Count-columns-per-day/m-p/114779#M30386</guid>
      <dc:creator>fbl_itcs</dc:creator>
      <dc:date>2020-09-28T16:06:20Z</dc:date>
    </item>
  </channel>
</rss>

