<?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 to invoke unarchive_cmd? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/How-to-invoke-unarchive-cmd/m-p/66828#M7249</link>
    <description>&lt;P&gt;I looked through &lt;CODE&gt;system/default/props.conf&lt;/CODE&gt; and it appears that you simply have to have your source-based stanza point to a custom/bogus sourcetype, which is where you set &lt;CODE&gt;invalid_cause = archive&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I think an example may make more sense then the paragraph above.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::....(tbz|tbz2)(.\d+)?]
unarchive_cmd = _auto
sourcetype = preprocess-bzip
NO_BINARY_CHECK = true

[source::....bz2?(.\d+)?]
unarchive_cmd = bzip2 -cd -
sourcetype = preprocess-bzip
NO_BINARY_CHECK = true

[preprocess-bzip]
invalid_cause = archive
is_valid = False
LEARN_MODEL = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;What I don't get is this:  What's the need for all the different "preprocess-*" sourcetypes?  I mean, why not just create a single &lt;CODE&gt;[preprocess-archive]&lt;/CODE&gt; (or something like that) and then just point all the &lt;CODE&gt;[source::...*]&lt;/CODE&gt; stuff to a single sourcetype.  All of the &lt;CODE&gt;preprocess-*&lt;/CODE&gt; sourcetype are identical in the system default file.  I don't think you ever see these sourcetypes within splunk, do you?&lt;/P&gt;</description>
    <pubDate>Fri, 08 Oct 2010 20:42:48 GMT</pubDate>
    <dc:creator>Lowell</dc:creator>
    <dc:date>2010-10-08T20:42:48Z</dc:date>
    <item>
      <title>How to invoke unarchive_cmd?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-invoke-unarchive-cmd/m-p/66827#M7248</link>
      <description>&lt;P&gt;I'm trying to set a custom archive processor.  Is this still supported in Splunk 4.1?&lt;/P&gt;

&lt;P&gt;The documentation is contradictory.  From props.conf.spec, the 2 parameters which both need to be set are &lt;CODE&gt;invalid_cause&lt;/CODE&gt; and &lt;CODE&gt;unarchive_cmd&lt;/CODE&gt;.  The descriptions say &lt;CODE&gt;invalid_cause&lt;/CODE&gt; can only be set for a sourcetype stanza, whereas &lt;CODE&gt;unarchive_cmd&lt;/CODE&gt; can only be set for a source stanza.  Is that even possible?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;invalid_cause = &amp;lt;string&amp;gt;
* Can only be set for a [&amp;lt;sourcetype&amp;gt;] stanza.
* Splunk does not index any data with invalid_cause set.
* Set &amp;lt;string&amp;gt; to "archive" to send the file to the archive processor (specified in unarchive_cmd).
* Set to any other string to throw an error in the splunkd.log if running Splunklogger in debug mode.
* Defaults to empty.

is_valid = true | false
* Automatically set by invalid_cause.
* DO NOT SET THIS.
* Defaults to true.

unarchive_cmd = &amp;lt;string&amp;gt;
* Only called if invalid_cause is set to "archive". This field is only valid on [source::stanzas].
* &amp;lt;string&amp;gt; specifies the shell command to run to extract an archived source.
* Must be a shell command that takes input on stdin and produces output on stdout.
* Use _auto for Splunk's automatic handling of archive files (tar, tar.gz, tgz, tbz, tbz2, zip)
* Defaults to empty.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I can't get the archive processor to activate.  Has anyone does this successfully?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2010 15:19:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-invoke-unarchive-cmd/m-p/66827#M7248</guid>
      <dc:creator>hulahoop</dc:creator>
      <dc:date>2010-10-08T15:19:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to invoke unarchive_cmd?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-invoke-unarchive-cmd/m-p/66828#M7249</link>
      <description>&lt;P&gt;I looked through &lt;CODE&gt;system/default/props.conf&lt;/CODE&gt; and it appears that you simply have to have your source-based stanza point to a custom/bogus sourcetype, which is where you set &lt;CODE&gt;invalid_cause = archive&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;I think an example may make more sense then the paragraph above.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::....(tbz|tbz2)(.\d+)?]
unarchive_cmd = _auto
sourcetype = preprocess-bzip
NO_BINARY_CHECK = true

[source::....bz2?(.\d+)?]
unarchive_cmd = bzip2 -cd -
sourcetype = preprocess-bzip
NO_BINARY_CHECK = true

[preprocess-bzip]
invalid_cause = archive
is_valid = False
LEARN_MODEL = false
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;/P&gt;&lt;HR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;What I don't get is this:  What's the need for all the different "preprocess-*" sourcetypes?  I mean, why not just create a single &lt;CODE&gt;[preprocess-archive]&lt;/CODE&gt; (or something like that) and then just point all the &lt;CODE&gt;[source::...*]&lt;/CODE&gt; stuff to a single sourcetype.  All of the &lt;CODE&gt;preprocess-*&lt;/CODE&gt; sourcetype are identical in the system default file.  I don't think you ever see these sourcetypes within splunk, do you?&lt;/P&gt;</description>
      <pubDate>Fri, 08 Oct 2010 20:42:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-invoke-unarchive-cmd/m-p/66828#M7249</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-10-08T20:42:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to invoke unarchive_cmd?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/How-to-invoke-unarchive-cmd/m-p/66829#M7250</link>
      <description>&lt;P&gt;Seems to be an old post but for those who are looking for it.. The purpose was to read some binary logs using archive processor. This configuration worked:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;props.conf:

[source::/path/to/log/directories/...log]
invalid_cause = archive
unarchive_cmd = executable_to_read_binary
sourcetype = binary_log
NO_BINARY_CHECK = true

[default]
maxDist = 500

inputs.conf:

[monitor:///path/to/log/directories]
sourcetype = binary_log
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;not sure sourcetype is mandatory to get this working. I was able to use invalid_cause under source::. Actually this is the only way it works for me. &lt;/P&gt;</description>
      <pubDate>Tue, 16 Aug 2011 19:00:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/How-to-invoke-unarchive-cmd/m-p/66829#M7250</guid>
      <dc:creator>ustun</dc:creator>
      <dc:date>2011-08-16T19:00:33Z</dc:date>
    </item>
  </channel>
</rss>

