<?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 can we programatically disable/enable a data input? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-programatically-disable-enable-a-data-input/m-p/541520#M93670</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello Mus&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a similar question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Script input&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know how to disable /opt/splunk/bin/scripts/test.sh?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2021 14:36:17 GMT</pubDate>
    <dc:creator>thkwon</dc:creator>
    <dc:date>2021-02-26T14:36:17Z</dc:date>
    <item>
      <title>How can we programatically disable/enable a data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-programatically-disable-enable-a-data-input/m-p/315209#M93668</link>
      <description>&lt;P&gt;We have an issue where for some reason, Splunk stops reading a log file in a particular Data Input folder.  The log is set to roll hourly.&lt;/P&gt;

&lt;P&gt;If we disable the Data Input, and then Re-Enable it, it starts reading the log again (which is probably the next log).&lt;/P&gt;

&lt;P&gt;We have a scheduled task that runs every hour to determine if it has captured any data in the past hour.  If it has not, we receive an email letting us know it is hung up and we have to Disable/Enable again.&lt;/P&gt;

&lt;P&gt;Is there a way to do so via a script?&lt;/P&gt;

&lt;P&gt;We are working to figure out what is wrong and have a case open, but are looking for an intermediary solution.&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 18:39:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-programatically-disable-enable-a-data-input/m-p/315209#M93668</guid>
      <dc:creator>dl-it-serveradm</dc:creator>
      <dc:date>2017-11-29T18:39:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can we programatically disable/enable a data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-programatically-disable-enable-a-data-input/m-p/315210#M93669</link>
      <description>&lt;P&gt;Hi dl-it-serveradmin,&lt;/P&gt;

&lt;P&gt;the easiest way is to use the REST API. Here is a screenshot of the input before the command:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3942iA57B72C292B5E1A5/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;By using this command:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  curl -k -u admin:&amp;lt;YourPWDHere&amp;gt; &lt;A href="https://localhost:8089/servicesNS/nobody/search/data/inputs/monitor/%252Ftmp" target="test_blank"&gt;https://localhost:8089/servicesNS/nobody/search/data/inputs/monitor/%252Ftmp&lt;/A&gt; -d disabled=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I was able to &lt;CODE&gt;disable&lt;/CODE&gt; the input:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/3943i7690847318E4E296/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;The reverse command would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; curl -k -u admin:&amp;lt;YourPWDHere&amp;gt; &lt;A href="https://localhost:8089/servicesNS/nobody/search/data/inputs/monitor/%252Ftmp" target="test_blank"&gt;https://localhost:8089/servicesNS/nobody/search/data/inputs/monitor/%252Ftmp&lt;/A&gt; -d disabled=false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I would also check this docs page about how Splunk handles log file rotation &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Data/Howlogfilerotationishandled"&gt;http://docs.splunk.com/Documentation/Splunk/latest/Data/Howlogfilerotationishandled&lt;/A&gt; because maybe you just need to change the way the files gets rotated and there will be no more need for the disable/enable action.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 29 Nov 2017 19:18:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-programatically-disable-enable-a-data-input/m-p/315210#M93669</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2017-11-29T19:18:35Z</dc:date>
    </item>
    <item>
      <title>Re: How can we programatically disable/enable a data input?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-can-we-programatically-disable-enable-a-data-input/m-p/541520#M93670</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello Mus&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a similar question.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Script input&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you know how to disable /opt/splunk/bin/scripts/test.sh?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2021 14:36:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-can-we-programatically-disable-enable-a-data-input/m-p/541520#M93670</guid>
      <dc:creator>thkwon</dc:creator>
      <dc:date>2021-02-26T14:36:17Z</dc:date>
    </item>
  </channel>
</rss>

