<?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: tstats missing row for missing data in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482530#M193230</link>
    <description>&lt;P&gt;Thanks for working this, this does work if we consider only 2 source types with exactly the same tabular format.&lt;BR /&gt;
But in future we may have a lot of sourcetypes , then it will be a problem to update the code for so many sourcetypes&lt;/P&gt;

&lt;P&gt;is there a better way to handle this, im sorry if i could not put my question correctly .. &lt;/P&gt;

&lt;P&gt;probably also consider multiple indexes and multiple source types...&lt;/P&gt;</description>
    <pubDate>Mon, 13 Jan 2020 13:15:49 GMT</pubDate>
    <dc:creator>jiaqya</dc:creator>
    <dc:date>2020-01-13T13:15:49Z</dc:date>
    <item>
      <title>tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482518#M193218</link>
      <description>&lt;P&gt;tstat works great when there is at least 1 event per day( span=1d).&lt;BR /&gt;
but when there is no data inserted, it completely ignores that date .&lt;/P&gt;

&lt;P&gt;but with timechart we do get a 0 for dates missing data.&lt;/P&gt;

&lt;P&gt;how can i get similar output with tstat.. output should show  0 for missing dates..&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 10:18:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482518#M193218</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-01-13T10:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482519#M193219</link>
      <description>&lt;P&gt;set fillnull_value=0&lt;/P&gt;

&lt;P&gt;more information on &lt;A href="https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Tstats"&gt;https://docs.splunk.com/Documentation/Splunk/8.0.1/SearchReference/Tstats&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 11:04:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482519#M193219</guid>
      <dc:creator>spj1oct</dc:creator>
      <dc:date>2020-01-13T11:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482520#M193220</link>
      <description>&lt;P&gt;what's your query?&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 11:45:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482520#M193220</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T11:45:41Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482521#M193221</link>
      <description>&lt;P&gt;|tstats count  where (index=name1 sourcetype=s1 earliest=-8d@d latest=-1d@d) groupby index,sourcetype,_time span=1d|reverse&lt;/P&gt;

&lt;P&gt;This is giving me 5 rows ,  but its missing 8th and 9th date since on those days indexing failed...&lt;BR /&gt;
i need to see those date rows with other column data (index sourcetype ) and the count should be 0 &lt;/P&gt;

&lt;P&gt;index   sourcetype  _time   count&lt;BR /&gt;
name1   s1  2020-01-11  18765&lt;BR /&gt;
name1   s1  2020-01-10  37575&lt;BR /&gt;
name1   s1  2020-01-07  18791&lt;BR /&gt;
name1   s1  2020-01-06  18789&lt;BR /&gt;
name1   s1  2020-01-05  18788&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 11:51:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482521#M193221</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-01-13T11:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482522#M193222</link>
      <description>&lt;P&gt;UPDATE(multiple index):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count prestats=t where index=name1 ( sourcetype=s1 OR sourcetype=s2 ) earliest=-8d@d latest=-1d@d by _time sourcetype span=1d
| timechart span=1d count by sourcetype
| untable _time sourcetype count
| eval index="name1"
| reverse
| table index sourcetype _time count
| append [  | tstats count prestats=t where index=name2 ....
....
|eval index="name2"
.... ]
| append [ | tstats count prestats=t where index=name3 ..... ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;H2&gt;It is better to search and append each index that has been added.&lt;/H2&gt;

&lt;P&gt;UPDATE(Display index):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count prestats=t where index=name1 ( sourcetype=s1 OR sourcetype=s2 ) earliest=-8d@d latest=-1d@d by _time sourcetype span=1d
| timechart span=1d count by sourcetype
| untable _time sourcetype count
| eval index="name1"
| reverse
| table index sourcetype _time count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hi, @jiaqya &lt;BR /&gt;
How about this?&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Display index:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count prestats=t where index=name1 ( sourcetype=s1 OR sourcetype=s2 ) earliest=-8d@d latest=-1d@d by _time sourcetype index span=1d
| stats count by _time index sourcetype 
| reverse
| timechart span=1d values(count) as count values(index) as index by sourcetype
| fields - "index: s2"
| rename "index: s1" as index
| rename "count: *" as *
| filldown index
| fillnull
| eval tmp=index.","._time
| fields - index _time
| untable tmp sourcetype count
| eval _time=mvindex(split(tmp,","),1) , index=mvindex(split(tmp,","),0)
| table index sourcetype _time count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;maybe works.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 11:55:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482522#M193222</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T11:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482523#M193223</link>
      <description>&lt;P&gt;for the question, this stays answered.&lt;/P&gt;

&lt;P&gt;Thanks, this works if its for a single index/stype ,  will this also work if there are multiple stypes ?&lt;BR /&gt;
suppose i have another sourcetype s2&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 11:59:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482523#M193223</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-01-13T11:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482524#M193224</link>
      <description>&lt;P&gt;@jiaqya&lt;BR /&gt;
my answer is updated. please confirm.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 12:04:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482524#M193224</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T12:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482525#M193225</link>
      <description>&lt;P&gt;Thanks for helping me on this.&lt;/P&gt;

&lt;P&gt;the final output should be similar to below , with index,stype values along with 0 dated records..&lt;/P&gt;

&lt;P&gt;index sourcetype _time count&lt;BR /&gt;
name1 s1 2020-01-11 18765&lt;BR /&gt;
name1 s1 2020-01-10 37575&lt;BR /&gt;
name1 s1 2020-01-07 18791&lt;BR /&gt;
name1 s1 2020-01-06 18789&lt;BR /&gt;
name1 s1 2020-01-05 18788&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 12:06:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482525#M193225</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-01-13T12:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482526#M193226</link>
      <description>&lt;P&gt;Why is the &lt;CODE&gt;index&lt;/CODE&gt; displayed?&lt;BR /&gt;
No &lt;CODE&gt;index&lt;/CODE&gt;  is displayed for my answer query.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time s1 s2
2020-01-11 **** ****
2020-01-10 **** ****
2020-01-09 **** ****
2020-01-08 **** ****
2020-01-07 **** ****
2020-01-06 **** ****
2020-01-05 **** ****
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I think the result is.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 12:14:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482526#M193226</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T12:14:06Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482527#M193227</link>
      <description>&lt;P&gt;but i need the index and sourcetype displayed for further processing...&lt;/P&gt;

&lt;P&gt;i am getting the desired output with tstats , but without the 0 value records, need the 0 value records also in same format.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 12:50:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482527#M193227</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-01-13T12:50:28Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482528#M193228</link>
      <description>&lt;P&gt;Error in 'stats' command: The argument 'fillnull_value=0' is invalid&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 12:52:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482528#M193228</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-01-13T12:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482529#M193229</link>
      <description>&lt;P&gt;@jiaqya&lt;BR /&gt;
my answer is updated.&lt;BR /&gt;
please confirm.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 12:56:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482529#M193229</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T12:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482530#M193230</link>
      <description>&lt;P&gt;Thanks for working this, this does work if we consider only 2 source types with exactly the same tabular format.&lt;BR /&gt;
But in future we may have a lot of sourcetypes , then it will be a problem to update the code for so many sourcetypes&lt;/P&gt;

&lt;P&gt;is there a better way to handle this, im sorry if i could not put my question correctly .. &lt;/P&gt;

&lt;P&gt;probably also consider multiple indexes and multiple source types...&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 13:15:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482530#M193230</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-01-13T13:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482531#M193231</link>
      <description>&lt;P&gt;The &lt;CODE&gt;fillnull_value&lt;/CODE&gt; option of &lt;CODE&gt;tstats&lt;/CODE&gt; is used when a field has &lt;EM&gt;no value&lt;/EM&gt;.&lt;/P&gt;

&lt;P&gt;In this case, the &lt;CODE&gt;_time&lt;/CODE&gt; field value is not missing and cannot be used because it is missing as a result of aggregation.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 13:16:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482531#M193231</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T13:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482532#M193232</link>
      <description>&lt;P&gt;Noted... Understood..&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 13:18:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482532#M193232</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-01-13T13:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482533#M193233</link>
      <description>&lt;P&gt;with my second query(maybe works), please change index and sourcetype:&lt;BR /&gt;
&lt;CODE&gt;(index=name1 OR index=name2 ...) (sourcetype=s1 OR sourcetype=s2 OR sourcetype=s3 ...)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;It doesn't matter how many sourcetypes you have.&lt;BR /&gt;
As the index increases, lines 5 and 6 may need to be modified.&lt;/P&gt;

&lt;P&gt;Please accept my answer.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 13:24:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482533#M193233</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T13:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482534#M193234</link>
      <description>&lt;P&gt;This does resolve my problem for now, but once the indexes/stypes increase can look at it later. thanks..&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 13:26:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482534#M193234</guid>
      <dc:creator>jiaqya</dc:creator>
      <dc:date>2020-01-13T13:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: tstats missing row for missing data</title>
      <link>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482535#M193235</link>
      <description>&lt;P&gt;you're welcome.&lt;BR /&gt;
In multiple indexes case, there is easy way that use &lt;CODE&gt;append&lt;/CODE&gt;.&lt;BR /&gt;
my answer is updated.&lt;/P&gt;

&lt;P&gt;happy splunking.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2020 14:14:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/tstats-missing-row-for-missing-data/m-p/482535#M193235</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-13T14:14:39Z</dc:date>
    </item>
  </channel>
</rss>

