<?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 find out the data available for a sourcetype in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413561#M119180</link>
    <description>&lt;P&gt;I'm assuming you want to know the retention period for your data, so here is my response. The retention period is setup at &lt;CODE&gt;index&lt;/CODE&gt; level, not at &lt;CODE&gt;sourcetype&lt;/CODE&gt; level. So what you need to do is find out which (or which all) index(es) your sourcetype is logging to and find the frozenTimePeriodInSecs attribute for that index (which defines the age of the bucket after it rolls to frozen).&lt;/P&gt;

&lt;P&gt;Query to find index name:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count WHERE index=* sourcetype=YourSourceTypeHere by index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above will give you one row for each index that sourcetype logs data to. Then for each such index, run following query to find the retention period.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/data/indexes/indexNameHereFromAboveSearch | stats values(frozenTimePeriodInSecs) as frozenTimePeriodInSecs | eval Age=tostring(frozenTimePeriodInSecs,"duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 21 May 2018 18:10:44 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-05-21T18:10:44Z</dc:date>
    <item>
      <title>how to find out the data available for a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413558#M119177</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
Can i please know about how to find out a old data available for a sourcetype. For example, if i have a sourcetype "xyx" , i want know until what time period data is available before rolled to frozen for this sourcetype .&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 17:42:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413558#M119177</guid>
      <dc:creator>iamlearner123</dc:creator>
      <dc:date>2018-05-21T17:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: how to find out the data available for a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413559#M119178</link>
      <description>&lt;P&gt;Check out this search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | dbinspect index=yourIndex | convert ctime(startTime) | convert ctime(endTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or maybe this one &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metadata type=sourcetypes
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 May 2018 18:03:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413559#M119178</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2018-05-21T18:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: how to find out the data available for a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413560#M119179</link>
      <description>&lt;P&gt;Hi iamlearner123,&lt;BR /&gt;
have you seen Monitoring Console?&lt;BR /&gt;
you have a detail for sourcetype (Index Detail: Instance) with the number of events, but you could also extract earlier event.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 21 May 2018 18:08:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413560#M119179</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2018-05-21T18:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to find out the data available for a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413561#M119180</link>
      <description>&lt;P&gt;I'm assuming you want to know the retention period for your data, so here is my response. The retention period is setup at &lt;CODE&gt;index&lt;/CODE&gt; level, not at &lt;CODE&gt;sourcetype&lt;/CODE&gt; level. So what you need to do is find out which (or which all) index(es) your sourcetype is logging to and find the frozenTimePeriodInSecs attribute for that index (which defines the age of the bucket after it rolls to frozen).&lt;/P&gt;

&lt;P&gt;Query to find index name:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count WHERE index=* sourcetype=YourSourceTypeHere by index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above will give you one row for each index that sourcetype logs data to. Then for each such index, run following query to find the retention period.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/data/indexes/indexNameHereFromAboveSearch | stats values(frozenTimePeriodInSecs) as frozenTimePeriodInSecs | eval Age=tostring(frozenTimePeriodInSecs,"duration")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 21 May 2018 18:10:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413561#M119180</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-05-21T18:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: how to find out the data available for a sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413562#M119181</link>
      <description>&lt;P&gt;Below query can be used to get data age of each sourcetypes.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count min(_time) as firstTime, max(_time) as lastTime, max(_indextime) as recentTime where index=*  by sourcetype, index, splunk_server 
| stats sum(count) as count, min(firstTime) as firstTime, max(lastTime) as lastTime, max(recentTime) as recentTime by sourcetype, index 
| fields - count 
| eval data_age=round((lastTime-firstTime)/86400,0)
| convert ctime(recentTime) ctime(firstTime) ctime(lastTime) ctime(lastUpdated) 
| fields index, sourcetype, firstTime, lastTime, data_age
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Note:&lt;/STRONG&gt; Make sure to select 'All time' in time-range picker.&lt;/P&gt;</description>
      <pubDate>Fri, 25 Jan 2019 01:39:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-find-out-the-data-available-for-a-sourcetype/m-p/413562#M119181</guid>
      <dc:creator>jawaharas</dc:creator>
      <dc:date>2019-01-25T01:39:09Z</dc:date>
    </item>
  </channel>
</rss>

