<?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 How to determine if logs are not being used? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312934#M93664</link>
    <description>&lt;P&gt;Is there a way to determine which logs are not being used anymore, and therefore can be deleted?  For example, maybe a team started logging something a year ago, but the team no longer uses that log for any reports/dashboards/etc...  Is there a way to find these unused logs?&lt;/P&gt;</description>
    <pubDate>Fri, 26 May 2017 15:25:16 GMT</pubDate>
    <dc:creator>JimSchlaker</dc:creator>
    <dc:date>2017-05-26T15:25:16Z</dc:date>
    <item>
      <title>How to determine if logs are not being used?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312934#M93664</link>
      <description>&lt;P&gt;Is there a way to determine which logs are not being used anymore, and therefore can be deleted?  For example, maybe a team started logging something a year ago, but the team no longer uses that log for any reports/dashboards/etc...  Is there a way to find these unused logs?&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 15:25:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312934#M93664</guid>
      <dc:creator>JimSchlaker</dc:creator>
      <dc:date>2017-05-26T15:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine if logs are not being used?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312935#M93665</link>
      <description>&lt;P&gt;hello JimSchlaker,&lt;BR /&gt;
there are answers here around which indexes are used for reports / saved searches / dashboards and more that you can relay on. for example:&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/273176/how-can-i-determine-how-much-an-index-is-being-sea.html"&gt;https://answers.splunk.com/answers/273176/how-can-i-determine-how-much-an-index-is-being-sea.html&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/186268/how-to-search-for-and-remove-indexes-in-splunk-tha.html"&gt;https://answers.splunk.com/answers/186268/how-to-search-for-and-remove-indexes-in-splunk-tha.html&lt;/A&gt;&lt;BR /&gt;
considering you mention also time span, meaning they might look at that particular index / source /sourcetype but not utilizing the old data, i would suggest an opposite way of approaching that challenge.&lt;BR /&gt;
will suggest to either check the timerange on searches using | rest or the _audit index to determine. or verify with teams, how far back they need their data and set a hard time limit in indexes.conf on the index contains that data&lt;BR /&gt;
hope it helps&lt;/P&gt;</description>
      <pubDate>Fri, 26 May 2017 15:55:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312935#M93665</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-05-26T15:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine if logs are not being used?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312936#M93666</link>
      <description>&lt;P&gt;In addition to the links mentioned by adonio, this search might get you some of the way there. However, things like macros can hide indexes/sourcetypes so it's not 100% but does also include data models/nodenames being used.&lt;/P&gt;

&lt;P&gt;The search filters out all "*" and "_*" references as those aren't very useful. It prefixes data models with "DM-" and nodenames with "ND-" and treats those as an index/sourcetype combo. Macros are prefixed with "MC-" to easily identify and look at manually.&lt;/P&gt;

&lt;P&gt;You could compare this against a REST call to the indexes or indexes-extended endpoint to get a starting point. BUT, you will want to confirm with data owners the indexes aren't actually being used since, again, this search is not 100%.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd_remote_searches
|dedup search

|eval
  search=replace(search, "(datamodel\s*=[\s\"]*)(.*?)([\|\s\"\)])", "\1DM-\2\3"),
  search=replace(search, "(eval\s+datamodel\s*=[\s\"]*)DM-", "\1"),
  search=replace(search, "(\|\s*pivot\s+)(.*?)(\s)", "\1DM-\2\3"),
  search=replace(search, "(nodename\s*=[\s\"]*)(.*?)([\|\s\"\)])", "\1ND-\2\3"),
  search=replace(search, "(eval\s+nodename\s*=[\s\"]*)ND-", "\1"),
  search=replace(search, "(search\s*`)(.*?)([`\(])", "\1MC-\2\3")

|rex field=search max_match=0 "index\s*=[\s\"]*(?&amp;lt;idx&amp;gt;.*?)[\|\s\"\)]"
|rex field=search max_match=0 "sourcetype\s*=[\s\"]*(?&amp;lt;st&amp;gt;.*?)[\|\s\"\)]"
|rex field=search max_match=0 "search\s*`(?&amp;lt;macro_index&amp;gt;MC-.*?)[`\(]"
|rex field=search max_match=0 "datamodel\s*=[\s\"]*(?&amp;lt;dm&amp;gt;DM-.*?)[\|\s\"\)]"
|rex field=search max_match=0 "nodename\s*=[\s\"]*(?&amp;lt;node&amp;gt;ND-.*?)[\|\s\"\)]"
|rex field=search max_match=0 "\|\s*pivot\s+(?&amp;lt;pv&amp;gt;.*?)\s"

|eval
  idx=mvdedup(mvappend(idx, macro_index, dm, pv)),
  idx=mvfilter(idx!="*" AND idx!="_*" AND NOT match(idx, "^_") AND NOT match(idx, "^\d+[\*_]")),
  st=mvdedup(mvappend(st, node))

|where isnotnull(idx) AND isnotnull(st)
|stats c by idx, st

|table idx, st
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 May 2017 20:53:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312936#M93666</guid>
      <dc:creator>kellewic</dc:creator>
      <dc:date>2017-05-26T20:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine if logs are not being used?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312937#M93667</link>
      <description>&lt;P&gt;One comment - I missed it when posting - in the mvfilter(), remove the last condition as that was specific to my use case when I made this - &lt;STRONG&gt;AND NOT match(idx, "^\d+[*_]")&lt;/STRONG&gt;. We have indexes that start with a numeric ID for each customer and I wanted to ignore those.&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 15:50:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312937#M93667</guid>
      <dc:creator>kellewic</dc:creator>
      <dc:date>2017-05-27T15:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to determine if logs are not being used?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312938#M93668</link>
      <description>&lt;P&gt;Check out these apps:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://splunkbase.splunk.com/app/2632/"&gt;https://splunkbase.splunk.com/app/2632/&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://splunkbase.splunk.com/app/493/"&gt;https://splunkbase.splunk.com/app/493/&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://splunkbase.splunk.com/app/2967/"&gt;https://splunkbase.splunk.com/app/2967/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 27 May 2017 17:01:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-determine-if-logs-are-not-being-used/m-p/312938#M93668</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-27T17:01:22Z</dc:date>
    </item>
  </channel>
</rss>

