<?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: Separate logging for input script in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Separate-logging-for-input-script/m-p/24564#M3893</link>
    <description>&lt;P&gt;If I had to, I suppose I would create a new file/file descriptor near the beginning of your script and redirect the stderr descriptor to it. I'd just write it to &lt;CODE&gt;$SPLUNK_HOME/var/log/splunk/&lt;/CODE&gt;. The environment variable &lt;CODE&gt;$SPLUNK_HOME&lt;/CODE&gt; should be available in your script when it is called by Splunk. You will need to do stuff like add your own timestamp to each line, as the output won't be captured and prepended by Splunk. A big disadvantage here though is you won't be rotating or cleaning up your own log without a lot of work.&lt;/P&gt;

&lt;P&gt;What I'd really do is, I'd leave it in splunkd.log and just make sure the beginning of my logged stderr output line have the name of my script so I can find and filter them easily in Splunk itself.&lt;/P&gt;</description>
    <pubDate>Tue, 03 Aug 2010 23:45:56 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2010-08-03T23:45:56Z</dc:date>
    <item>
      <title>Separate logging for input script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Separate-logging-for-input-script/m-p/24563#M3892</link>
      <description>&lt;P&gt;I'm using a scripted input for an application. The script writes warnings to stderr, which makes them show up in splunkd.log. I want to save the messages, but I don't want to mix them with the logs in splunkd.log. How can I set up separate logging for my script? And where should the log file be saved?&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2010 22:45:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Separate-logging-for-input-script/m-p/24563#M3892</guid>
      <dc:creator>erydberg</dc:creator>
      <dc:date>2010-08-03T22:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: Separate logging for input script</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Separate-logging-for-input-script/m-p/24564#M3893</link>
      <description>&lt;P&gt;If I had to, I suppose I would create a new file/file descriptor near the beginning of your script and redirect the stderr descriptor to it. I'd just write it to &lt;CODE&gt;$SPLUNK_HOME/var/log/splunk/&lt;/CODE&gt;. The environment variable &lt;CODE&gt;$SPLUNK_HOME&lt;/CODE&gt; should be available in your script when it is called by Splunk. You will need to do stuff like add your own timestamp to each line, as the output won't be captured and prepended by Splunk. A big disadvantage here though is you won't be rotating or cleaning up your own log without a lot of work.&lt;/P&gt;

&lt;P&gt;What I'd really do is, I'd leave it in splunkd.log and just make sure the beginning of my logged stderr output line have the name of my script so I can find and filter them easily in Splunk itself.&lt;/P&gt;</description>
      <pubDate>Tue, 03 Aug 2010 23:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Separate-logging-for-input-script/m-p/24564#M3893</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-08-03T23:45:56Z</dc:date>
    </item>
  </channel>
</rss>

