<?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 can we automatically delete old files we're monitoring? in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/How-can-we-automatically-delete-old-files-we-re-monitoring/m-p/633834#M9371</link>
    <description>&lt;P&gt;Hello Splunkers!!&lt;/P&gt;
&lt;P&gt;As mentioned below we have these two files which are carrying payload events which we monitored already. But on a daily basis with new timestamp we want to monitor new files and delete the existing monitored files from that path. Is there any mechanism to achieve this.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;WPLAT_order_2023-03-07T14-35-21.669Z.json&lt;BR /&gt;WPLAT_order_2023-03-08T15-45-30.232Z.json&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Suppose for example :&lt;/P&gt;
&lt;P&gt;day 1 :&amp;nbsp; under D:\\splunk folder we are monitoring below two files.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;WPLAT_order_2023-03-07T14-35-21.669Z.json&lt;BR /&gt;WPLAT_order_2023-03-08T15-45-30.232Z.json&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;day 2: we need to delete day 1 files from folder D:\\ and monitor the new created files with new timestamps.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;WPLAT_order_2023-03-09T11-35-21.669Z.json&lt;BR /&gt;WPLAT_order_2023-03-10T12-45-30.232Z.json&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 Mar 2023 13:18:56 GMT</pubDate>
    <dc:creator>uagraw01</dc:creator>
    <dc:date>2023-03-13T13:18:56Z</dc:date>
    <item>
      <title>How can we automatically delete old files we're monitoring?</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-can-we-automatically-delete-old-files-we-re-monitoring/m-p/633834#M9371</link>
      <description>&lt;P&gt;Hello Splunkers!!&lt;/P&gt;
&lt;P&gt;As mentioned below we have these two files which are carrying payload events which we monitored already. But on a daily basis with new timestamp we want to monitor new files and delete the existing monitored files from that path. Is there any mechanism to achieve this.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class=""&gt;WPLAT_order_2023-03-07T14-35-21.669Z.json&lt;BR /&gt;WPLAT_order_2023-03-08T15-45-30.232Z.json&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Suppose for example :&lt;/P&gt;
&lt;P&gt;day 1 :&amp;nbsp; under D:\\splunk folder we are monitoring below two files.&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;WPLAT_order_2023-03-07T14-35-21.669Z.json&lt;BR /&gt;WPLAT_order_2023-03-08T15-45-30.232Z.json&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;day 2: we need to delete day 1 files from folder D:\\ and monitor the new created files with new timestamps.&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;SPAN class=""&gt;WPLAT_order_2023-03-09T11-35-21.669Z.json&lt;BR /&gt;WPLAT_order_2023-03-10T12-45-30.232Z.json&lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Mar 2023 13:18:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-can-we-automatically-delete-old-files-we-re-monitoring/m-p/633834#M9371</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2023-03-13T13:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: monitoring</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-can-we-automatically-delete-old-files-we-re-monitoring/m-p/633842#M9374</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/70277"&gt;@uagraw01&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;as you can read at&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/9.0.4/Admin/Inputsconf" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/9.0.4/Admin/Inputsconf&lt;/A&gt;&amp;nbsp;you can use the "batch" command instead "monitor", so, Splunk deletes the file after reading.&lt;/P&gt;&lt;P&gt;So you have to create an input like the following:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[batch:///&amp;lt;your_path&amp;gt;/WPLAT_order_*.json]
disabled = 0
index = &amp;lt;your_index&amp;gt;
sourcetype = &amp;lt;your_sourcetype&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 07:43:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-can-we-automatically-delete-old-files-we-re-monitoring/m-p/633842#M9374</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-09T07:43:23Z</dc:date>
    </item>
    <item>
      <title>Re: monitoring</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-can-we-automatically-delete-old-files-we-re-monitoring/m-p/633865#M9377</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;we need to mention&amp;nbsp;&lt;/P&gt;&lt;P&gt;move_policy = sinkhole&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 10:33:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-can-we-automatically-delete-old-files-we-re-monitoring/m-p/633865#M9377</guid>
      <dc:creator>uagraw01</dc:creator>
      <dc:date>2023-03-09T10:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: monitoring</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/How-can-we-automatically-delete-old-files-we-re-monitoring/m-p/633868#M9380</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/70277"&gt;@uagraw01&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;ok, find you configuration so you learn how to do and add your additional configurations to your inputs.conf.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Thu, 09 Mar 2023 10:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/How-can-we-automatically-delete-old-files-we-re-monitoring/m-p/633868#M9380</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-03-09T10:57:07Z</dc:date>
    </item>
  </channel>
</rss>

