<?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 unarchive_cmd with Java on a Windows system in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/unarchive-cmd-with-Java-on-a-Windows-system/m-p/346943#M63709</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have a question for the property unarchive_cmd. I want to parse a textfile and recombine info to a new Log before indexing data.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::C:\\Users\\...\\testlog\\...txt]
unarchive_cmd = java -jar LogConverter.jar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The command is never run. Does anybody have any ideas?&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2017 13:10:21 GMT</pubDate>
    <dc:creator>SK8</dc:creator>
    <dc:date>2017-11-08T13:10:21Z</dc:date>
    <item>
      <title>unarchive_cmd with Java on a Windows system</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/unarchive-cmd-with-Java-on-a-Windows-system/m-p/346943#M63709</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I have a question for the property unarchive_cmd. I want to parse a textfile and recombine info to a new Log before indexing data.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::C:\\Users\\...\\testlog\\...txt]
unarchive_cmd = java -jar LogConverter.jar
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The command is never run. Does anybody have any ideas?&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 13:10:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/unarchive-cmd-with-Java-on-a-Windows-system/m-p/346943#M63709</guid>
      <dc:creator>SK8</dc:creator>
      <dc:date>2017-11-08T13:10:21Z</dc:date>
    </item>
    <item>
      <title>Re: unarchive_cmd with Java on a Windows system</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/unarchive-cmd-with-Java-on-a-Windows-system/m-p/346944#M63710</link>
      <description>&lt;P&gt;Same question from my side. I got this running on a Linux universal forwarder, but by a Windows universal forwarder, the command is never run (knowing that because the Java could would otherwise write to a log file).&lt;/P&gt;

&lt;P&gt;splunkd.log shows that the archive is processed ("Finishied processing file ..." messages from the ArchiveProcessor), so the "invalid_cause = archive" setting is working.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 13:45:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/unarchive-cmd-with-Java-on-a-Windows-system/m-p/346944#M63710</guid>
      <dc:creator>Martin_Doering</dc:creator>
      <dc:date>2017-12-04T13:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: unarchive_cmd with Java on a Windows system</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/unarchive-cmd-with-Java-on-a-Windows-system/m-p/346945#M63711</link>
      <description>&lt;P&gt;Made some progress: I now see some warnings of the "ArchiveContext" component:&lt;BR /&gt;
Command cmd="java -cp "C:\Program Files\SplunkUniversalForwarder\etc\apps\bin.jar" " for archive= failed: exited with code 1.&lt;/P&gt;

&lt;P&gt;Need to find out what this is about. My own code does not exit with status code 1 (but rather with 0 or negative numbers).&lt;/P&gt;</description>
      <pubDate>Mon, 04 Dec 2017 14:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/unarchive-cmd-with-Java-on-a-Windows-system/m-p/346945#M63711</guid>
      <dc:creator>Martin_Doering</dc:creator>
      <dc:date>2017-12-04T14:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: unarchive_cmd with Java on a Windows system</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/unarchive-cmd-with-Java-on-a-Windows-system/m-p/346946#M63712</link>
      <description>&lt;P&gt;I finally got this running on Splunk 6.6.4. The following is required:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;&lt;CODE&gt;invalid_cmd=archive&lt;/CODE&gt; needs to be included in the &lt;CODE&gt;source&lt;/CODE&gt; stanza (not in the &lt;CODE&gt;sourcetype&lt;/CODE&gt; stanza as stated in the docs).&lt;/LI&gt;
&lt;LI&gt;The jar archive must be specified with its full absolute path.&lt;/LI&gt;
&lt;LI&gt;However, this file path &lt;STRONG&gt;must not&lt;/STRONG&gt; contain spaces nor quotation marks. This makes the standard path of &lt;CODE&gt;"C:\Program Files\SplunkUniversalForwarder\..."&lt;/CODE&gt; impossible to use. I had to change this to &lt;CODE&gt;C:\Progra~1\SplunkUniversalForwarder\...&lt;/CODE&gt; to omit both spaces and quotation marks.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;The only difference of my configuration to the problem stated in the question is that I do not use runnable jar files, so my Java call is &lt;CODE&gt;java -cp C:\Progra~1\SplunkUniversalForwarder\... CLASS_NAME&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I have deployed this to a Windows Universal Forwarder that in turn forwards the parsed data to a Linux Heavy Forwarder. On the HF, I perform some additional field extractions from the file name (which is not available for the &lt;CODE&gt;unarchive_cmd&lt;/CODE&gt;). So on the UF, &lt;CODE&gt;props.conf&lt;/CODE&gt; only contains &lt;CODE&gt;source&lt;/CODE&gt; stanzas, and on the HF, &lt;CODE&gt;props.conf&lt;/CODE&gt; only contains &lt;CODE&gt;sourcetype&lt;/CODE&gt; stanzas.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 14:31:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/unarchive-cmd-with-Java-on-a-Windows-system/m-p/346946#M63712</guid>
      <dc:creator>Martin_Doering</dc:creator>
      <dc:date>2018-01-09T14:31:55Z</dc:date>
    </item>
  </channel>
</rss>

