<?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 script input running &amp;quot;splunk cmd openssl&amp;quot; in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/script-input-running-quot-splunk-cmd-openssl-quot/m-p/517786#M87592</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a script to index enddate from certificats&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#!/bin/sh

echo debug enddate
date=`date "+%d/%m/%Y %H:%M:%S"`

for file in `/usr/bin/ls /opt/splunk/etc/auth/mycerts/*.pem`
do
    echo debug befor $file
    /opt/splunk/bin/openssl x509 -in $file -enddate -noout
    echo debug after $file
done&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This script is started from this stanza in inputs.conf:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[script://./bin/certificats]
interval = * * * * *
index=my_index
sourcetype = splunk:certificats
start_by_shell = false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is wriking well when I start it from shell with the splunk account (which is also runnig Splunk) and I enddate is printed for both .pem files thar are in mycerts directory.&lt;/P&gt;&lt;P&gt;But when it is started from Splunk, only the lines "debug endate" and "debug befor $file" are indexed (debug befor only for the first file).&lt;/P&gt;&lt;P&gt;I also try with the command "/opt/splunk/bin/splunk cmd openssl x509 -in $file -enddate -noout". This don't change anything.&lt;/P&gt;&lt;P&gt;Do you have an idee why the command openssl give no result and exit the script when started from Splunk?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 03 Sep 2020 21:33:27 GMT</pubDate>
    <dc:creator>ktn01</dc:creator>
    <dc:date>2020-09-03T21:33:27Z</dc:date>
    <item>
      <title>script input running "splunk cmd openssl"</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/script-input-running-quot-splunk-cmd-openssl-quot/m-p/517786#M87592</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a script to index enddate from certificats&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;#!/bin/sh

echo debug enddate
date=`date "+%d/%m/%Y %H:%M:%S"`

for file in `/usr/bin/ls /opt/splunk/etc/auth/mycerts/*.pem`
do
    echo debug befor $file
    /opt/splunk/bin/openssl x509 -in $file -enddate -noout
    echo debug after $file
done&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This script is started from this stanza in inputs.conf:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[script://./bin/certificats]
interval = * * * * *
index=my_index
sourcetype = splunk:certificats
start_by_shell = false&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The script is wriking well when I start it from shell with the splunk account (which is also runnig Splunk) and I enddate is printed for both .pem files thar are in mycerts directory.&lt;/P&gt;&lt;P&gt;But when it is started from Splunk, only the lines "debug endate" and "debug befor $file" are indexed (debug befor only for the first file).&lt;/P&gt;&lt;P&gt;I also try with the command "/opt/splunk/bin/splunk cmd openssl x509 -in $file -enddate -noout". This don't change anything.&lt;/P&gt;&lt;P&gt;Do you have an idee why the command openssl give no result and exit the script when started from Splunk?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 03 Sep 2020 21:33:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/script-input-running-quot-splunk-cmd-openssl-quot/m-p/517786#M87592</guid>
      <dc:creator>ktn01</dc:creator>
      <dc:date>2020-09-03T21:33:27Z</dc:date>
    </item>
  </channel>
</rss>

