<?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: Running a basic search on XML formated events, why are search peers reporting &amp;quot;Cannot find program 'xmlkv' or script 'xmlkv'&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205881#M59878</link>
    <description>&lt;P&gt;You're trying to use wildcards in field names? &lt;CODE&gt;spath&lt;/CODE&gt; is not to blame here, &lt;CODE&gt;search&lt;/CODE&gt; can't do that this way.&lt;/P&gt;

&lt;P&gt;What's your actual requirement, find the element with an attribute status set to anything other than ok?&lt;/P&gt;</description>
    <pubDate>Thu, 14 Apr 2016 23:46:17 GMT</pubDate>
    <dc:creator>martin_mueller</dc:creator>
    <dc:date>2016-04-14T23:46:17Z</dc:date>
    <item>
      <title>Running a basic search on XML formated events, why are search peers reporting "Cannot find program 'xmlkv' or script 'xmlkv'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205877#M59874</link>
      <description>&lt;P&gt;I'm trying to run a very basic search against XML formatted events:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=ilo:events | xmlkv
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm getting the following error back from my search head:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;9 errors occurred while the search was executing. Therefore, search results might be incomplete. Hide errors. 
•[SearchPeer1] Streamed search execute failed because: Error in 'xmlkv' command: Cannot find program 'xmlkv' or script 'xmlkv'.
•[SearchPeer2] Search process did not exit cleanly, exit_code=255, description="exited with code 255". Please look in search.log for this peer in the Job Inspector for more info.
•[Searchpeer2] Streamed search execute failed because: Error in 'xmlkv' command: Cannot find program 'xmlkv' or script 'xmlkv'.
•[SearchPeer3] Search process did not exit cleanly, exit_code=-1, description="exited with code -1". Please look in search.log for this peer in the Job Inspector for more info.
•[Searchpeer3] Streamed search execute failed because: Error in 'xmlkv' command: Cannot find program 'xmlkv' or script 'xmlkv'.
•[Searchpeer4] Streamed search execute failed because: Error in 'xmlkv' command: Cannot find program 'xmlkv' or script 'xmlkv'.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;so on and so on..&lt;/P&gt;

&lt;P&gt;But I can check each of these indexers and xmlkv is indeed there and enabled with global read permissions..&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:38:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205877#M59874</guid>
      <dc:creator>mjones414</dc:creator>
      <dc:date>2016-04-14T19:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Running a basic search on XML formated events, why are search peers reporting "Cannot find program 'xmlkv' or script 'xmlkv'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205878#M59875</link>
      <description>&lt;P&gt;running splunk 6.3.1 on search head and on all indexers.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 19:45:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205878#M59875</guid>
      <dc:creator>mjones414</dc:creator>
      <dc:date>2016-04-14T19:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: Running a basic search on XML formated events, why are search peers reporting "Cannot find program 'xmlkv' or script 'xmlkv'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205879#M59876</link>
      <description>&lt;P&gt;Slightly different direction, but you should be able to use the built-in &lt;CODE&gt;spath&lt;/CODE&gt; command to parse XML... should be faster than an external Python command.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.4.0/SearchReference/Spath"&gt;http://docs.splunk.com/Documentation/Splunk/6.4.0/SearchReference/Spath&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 22:04:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205879#M59876</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-14T22:04:20Z</dc:date>
    </item>
    <item>
      <title>Re: Running a basic search on XML formated events, why are search peers reporting "Cannot find program 'xmlkv' or script 'xmlkv'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205880#M59877</link>
      <description>&lt;P&gt;This led me down an interesting little rabbit hole!  So spath did actually break the XML the way I'd hoped, but it doesn't appear to know how to deal with wildcards in the field name.  This led me to xpath, but when I tried to use xpath it broke in the exact same fashion xmlkv did!&lt;/P&gt;

&lt;P&gt;Here's an example block I'm trying to parse:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; &amp;lt;GET_EMBEDDED_HEALTH_DATA&amp;gt;
         &amp;lt;HEALTH_AT_A_GLANCE&amp;gt;
              &amp;lt;BIOS_HARDWARE STATUS= "Failed"/&amp;gt;
              &amp;lt;FANS STATUS= "OK"/&amp;gt;
              &amp;lt;TEMPERATURE STATUS= "OK"/&amp;gt;
              &amp;lt;POWER_SUPPLIES STATUS= "OK"/&amp;gt;
              &amp;lt;PROCESSOR STATUS= "OK"/&amp;gt;
              &amp;lt;MEMORY STATUS= "OK"/&amp;gt;
              &amp;lt;NETWORK STATUS= "OK"/&amp;gt;
              &amp;lt;STORAGE STATUS= "OK"/&amp;gt;
         &amp;lt;/HEALTH_AT_A_GLANCE&amp;gt;
    &amp;lt;/GET_EMBEDDED_HEALTH_DATA&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So I  was trying to use a search string like this:&lt;/P&gt;

&lt;P&gt;sourcetype=ilo:systemhealth | spath | search "GET_EMBEDDED_HEALTH_DATA.HEALTH_AT_A_GLANCE.*" NOT "OK"&lt;/P&gt;

&lt;P&gt;the whole event is in the neighborhood of 500 lines of nested xml, because below this it captures more detail about the hardware component tests.  The idea is to filter within this xml block in the search and table out the offending hardware component and specific details later.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:25:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205880#M59877</guid>
      <dc:creator>mjones414</dc:creator>
      <dc:date>2020-09-29T09:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Running a basic search on XML formated events, why are search peers reporting "Cannot find program 'xmlkv' or script 'xmlkv'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205881#M59878</link>
      <description>&lt;P&gt;You're trying to use wildcards in field names? &lt;CODE&gt;spath&lt;/CODE&gt; is not to blame here, &lt;CODE&gt;search&lt;/CODE&gt; can't do that this way.&lt;/P&gt;

&lt;P&gt;What's your actual requirement, find the element with an attribute status set to anything other than ok?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 23:46:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205881#M59878</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-14T23:46:17Z</dc:date>
    </item>
    <item>
      <title>Re: Running a basic search on XML formated events, why are search peers reporting "Cannot find program 'xmlkv' or script 'xmlkv'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205882#M59879</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | spath | eval offender = "" | foreach *{@STATUS} [eval offender = offender . if('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' == "OK", "", " &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;,")]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;foreach&lt;/CODE&gt; does a bit of magic:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;run for each field name ending in "this is an xml attribute called status"&lt;/LI&gt;
&lt;LI&gt;check if field value is OK, do nothing&lt;/LI&gt;
&lt;LI&gt;else add field name as string to the list of offenders&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 14 Apr 2016 23:50:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205882#M59879</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2016-04-14T23:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Running a basic search on XML formated events, why are search peers reporting "Cannot find program 'xmlkv' or script 'xmlkv'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205883#M59880</link>
      <description>&lt;P&gt;yep that is correct.   but like i said this is one block of a 500 line event, this block is what I want to trigger off of for an alert, the rest of the block, which I'd want included in the alert, will have the lower level details. like, error code, temperature, firmware revision, etc etc.  so specifically anything not OK or Redundant in the health_at_a_glance level&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:30:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205883#M59880</guid>
      <dc:creator>mjones414</dc:creator>
      <dc:date>2020-09-29T09:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Running a basic search on XML formated events, why are search peers reporting "Cannot find program 'xmlkv' or script 'xmlkv'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205884#M59881</link>
      <description>&lt;P&gt;I've tried a few different ways to upload a complete xml sample but the webpage will not submit it... &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Apr 2016 19:57:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205884#M59881</guid>
      <dc:creator>mjones414</dc:creator>
      <dc:date>2016-04-18T19:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: Running a basic search on XML formated events, why are search peers reporting "Cannot find program 'xmlkv' or script 'xmlkv'"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205885#M59882</link>
      <description>&lt;P&gt;Unfortunately I was not able to make spath do what I needed to do, BUT I have learned what was causing xmlkv and xpath to fail.&lt;/P&gt;

&lt;P&gt;Looks like one of my colleagues set:&lt;/P&gt;

&lt;P&gt;[replicationBlacklist]&lt;BR /&gt;
noBinDir = (.../bin/*)&lt;/P&gt;

&lt;P&gt;in /opt/splunk/etc/system/local/distsearch.conf&lt;/P&gt;

&lt;P&gt;Loosening this up enabled the replication bundle to push the .py scripts to the search peers and allowed the search to complete.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Apr 2016 22:13:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Running-a-basic-search-on-XML-formated-events-why-are-search/m-p/205885#M59882</guid>
      <dc:creator>mjones414</dc:creator>
      <dc:date>2016-04-25T22:13:40Z</dc:date>
    </item>
  </channel>
</rss>

