<?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: inputlookup in view with rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-view-with-rex/m-p/70782#M17726</link>
    <description>&lt;P&gt;Yes, or rather it is the tags in the &lt;CODE&gt;rex&lt;/CODE&gt; command that is causing trouble. Since you're enclosing them in an XML document, they are interpreted as part of the XML data rather than as part of the &lt;CODE&gt;rex&lt;/CODE&gt; command. To specify that these tags are not referring to the XML structure, use the special escaping sequence &lt;CODE&gt;&amp;lt;![CDATA[&lt;/CODE&gt; and its corresponding end sequence &lt;CODE&gt;]]&amp;gt;&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Code Rule Search&amp;lt;/label&amp;gt;
  &amp;lt;searchTemplate&amp;gt;| inputlookup pp-fw-rule-tracker appcode=$appcode$ | table rule_name,cluster | sort cluster desc&amp;lt;/searchTemplate&amp;gt;

&amp;lt;fieldset&amp;gt;
   &amp;lt;input type="dropdown" token="appcode"&amp;gt;
   &amp;lt;label&amp;gt;select appcode&amp;lt;/label&amp;gt;
   &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
   &amp;lt;populatingSearch fieldForValue="appcode" fieldForLabel="appcode"&amp;gt;&amp;lt;![CDATA[| inputlookup pp-fw-rule-tracker |rex field=rule_name "(?&amp;lt;appcode&amp;gt;^[\"]{0,1}[a-zA-Z\d]{4})-" | dedup appcode |table appcode]]&amp;gt;&amp;lt;/populatingSearch&amp;gt;
  &amp;lt;/input&amp;gt;
&amp;lt;/fieldset&amp;gt;
&amp;lt;row&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;title&amp;gt;Rules matching Appcode from Tracker CSV&amp;lt;/title&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 06 Sep 2011 19:39:52 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2011-09-06T19:39:52Z</dc:date>
    <item>
      <title>inputlookup in view with rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-view-with-rex/m-p/70781#M17725</link>
      <description>&lt;P&gt;I have a csv file that tracks firewall rule hits. I would like to create a form that reads the csv and populates a drop down menu that allows the user to select a field extracted via rex which will populate a larger search from the same csv.&lt;BR /&gt;
The rule_name field may have a 4 character (alpha numeric)identified that will define a group responsible for those rules.  That is the field I want to show in the dropdown field.&lt;/P&gt;

&lt;P&gt;here is the form code that I want to use, however splunk spits back an invalid XML message.&lt;BR /&gt;
As far as i can tell the xml is valid (no broken tags), is it the rex command that causes the error?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Code Rule Search&amp;lt;/label&amp;gt;
  &amp;lt;searchTemplate&amp;gt;| inputlookup pp-fw-rule-tracker appcode=$appcode$ | table rule_name,cluster | sort cluster desc&amp;lt;/searchTemplate&amp;gt;

&amp;lt;fieldset&amp;gt;
   &amp;lt;input type="dropdown" token="appcode"&amp;gt;
   &amp;lt;label&amp;gt;select appcode&amp;lt;/label&amp;gt;
   &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
   &amp;lt;populatingSearch fieldForValue="appcode" fieldForLabel="appcode"&amp;gt;| inputlookup pp-fw-rule-tracker |rex field=rule_name "(?&amp;lt;appcode&amp;gt;^[\"]{0,1}[a-zA-Z\d]{4})-" | dedup appcode |table appcode&amp;lt;/populatingSearch&amp;gt;
  &amp;lt;/input&amp;gt;
&amp;lt;/fieldset&amp;gt;
&amp;lt;row&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;title&amp;gt;Rules matching Appcode from Tracker CSV&amp;lt;/title&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Sep 2011 19:04:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-view-with-rex/m-p/70781#M17725</guid>
      <dc:creator>EricPartington</dc:creator>
      <dc:date>2011-09-06T19:04:35Z</dc:date>
    </item>
    <item>
      <title>Re: inputlookup in view with rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-view-with-rex/m-p/70782#M17726</link>
      <description>&lt;P&gt;Yes, or rather it is the tags in the &lt;CODE&gt;rex&lt;/CODE&gt; command that is causing trouble. Since you're enclosing them in an XML document, they are interpreted as part of the XML data rather than as part of the &lt;CODE&gt;rex&lt;/CODE&gt; command. To specify that these tags are not referring to the XML structure, use the special escaping sequence &lt;CODE&gt;&amp;lt;![CDATA[&lt;/CODE&gt; and its corresponding end sequence &lt;CODE&gt;]]&amp;gt;&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Code Rule Search&amp;lt;/label&amp;gt;
  &amp;lt;searchTemplate&amp;gt;| inputlookup pp-fw-rule-tracker appcode=$appcode$ | table rule_name,cluster | sort cluster desc&amp;lt;/searchTemplate&amp;gt;

&amp;lt;fieldset&amp;gt;
   &amp;lt;input type="dropdown" token="appcode"&amp;gt;
   &amp;lt;label&amp;gt;select appcode&amp;lt;/label&amp;gt;
   &amp;lt;choice value="*"&amp;gt;All&amp;lt;/choice&amp;gt;
   &amp;lt;populatingSearch fieldForValue="appcode" fieldForLabel="appcode"&amp;gt;&amp;lt;![CDATA[| inputlookup pp-fw-rule-tracker |rex field=rule_name "(?&amp;lt;appcode&amp;gt;^[\"]{0,1}[a-zA-Z\d]{4})-" | dedup appcode |table appcode]]&amp;gt;&amp;lt;/populatingSearch&amp;gt;
  &amp;lt;/input&amp;gt;
&amp;lt;/fieldset&amp;gt;
&amp;lt;row&amp;gt;
  &amp;lt;table&amp;gt;
    &amp;lt;title&amp;gt;Rules matching Appcode from Tracker CSV&amp;lt;/title&amp;gt;
  &amp;lt;/table&amp;gt;
&amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 06 Sep 2011 19:39:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/inputlookup-in-view-with-rex/m-p/70782#M17726</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-09-06T19:39:52Z</dc:date>
    </item>
  </channel>
</rss>

