<?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 Is it possible to use the oneshot command in a bash script without login prompt? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-use-the-oneshot-command-in-a-bash-script/m-p/463217#M79950</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;bash-4.1# cat test_script
#!/bin/bash
sudo -H  -u splunk bash -c '/opt/splunk/bin/splunk add oneshot /opt/splunk/etc/system/local/log_dir/log_file* -index test -sourcetype test_log -auth admin:pass'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This shell script is set to a cronjob. It works perfectly for the first couple of cron schedules, then stops working. When I try to run it manually, I get a “login failed” error. I believe this is due to security features on the server don’t like the plane text password.&lt;BR /&gt;
Is it possible to disable login &amp;amp; password authentication for the oneshot command so the shell script can execute? Otherwise, what other options do I have. Thanks for your help in advance.&lt;/P&gt;

&lt;P&gt;OS – REDHAT 6&lt;BR /&gt;
SPLUNK VERSION – 7.0.1&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2019 13:34:04 GMT</pubDate>
    <dc:creator>dajibade</dc:creator>
    <dc:date>2019-12-09T13:34:04Z</dc:date>
    <item>
      <title>Is it possible to use the oneshot command in a bash script without login prompt?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-use-the-oneshot-command-in-a-bash-script/m-p/463217#M79950</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;bash-4.1# cat test_script
#!/bin/bash
sudo -H  -u splunk bash -c '/opt/splunk/bin/splunk add oneshot /opt/splunk/etc/system/local/log_dir/log_file* -index test -sourcetype test_log -auth admin:pass'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This shell script is set to a cronjob. It works perfectly for the first couple of cron schedules, then stops working. When I try to run it manually, I get a “login failed” error. I believe this is due to security features on the server don’t like the plane text password.&lt;BR /&gt;
Is it possible to disable login &amp;amp; password authentication for the oneshot command so the shell script can execute? Otherwise, what other options do I have. Thanks for your help in advance.&lt;/P&gt;

&lt;P&gt;OS – REDHAT 6&lt;BR /&gt;
SPLUNK VERSION – 7.0.1&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 13:34:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-use-the-oneshot-command-in-a-bash-script/m-p/463217#M79950</guid>
      <dc:creator>dajibade</dc:creator>
      <dc:date>2019-12-09T13:34:04Z</dc:date>
    </item>
    <item>
      <title>Re: Is it possible to use the oneshot command in a bash script without login prompt?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-use-the-oneshot-command-in-a-bash-script/m-p/463218#M79951</link>
      <description>&lt;P&gt;why oneshot every time? cant you monitor the file path / directories with inputs.conf? &lt;BR /&gt;
also, looks like you are trying to check changes in your &lt;CODE&gt;.../etc/system/local/...&lt;/CODE&gt; files to monitor changes.&lt;BR /&gt;
there are easier ways to do so, for example: use &lt;CODE&gt;| rest ...&lt;/CODE&gt; commands to bring the relevant results, put them in a summary index and check changes, copy the structure of folders to another place, for example: &lt;CODE&gt;/tmp&lt;/CODE&gt; and run &lt;CODE&gt;diff&lt;/CODE&gt; command and send output to splunk via scripted input, etc ...&lt;/P&gt;

&lt;P&gt;hope it helps&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 20:46:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Is-it-possible-to-use-the-oneshot-command-in-a-bash-script/m-p/463218#M79951</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2019-12-10T20:46:14Z</dc:date>
    </item>
  </channel>
</rss>

