<?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: Conditionaly Change form input  variable value in the form search query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Conditionaly-Change-form-input-variable-value-in-the-form-search/m-p/268610#M80792</link>
    <description>&lt;P&gt;For your splunk search, have you tried &lt;CODE&gt;.. | where like(ip, $ip$)&lt;/CODE&gt;. With this approach, you will not have to change the &lt;CODE&gt;%&lt;/CODE&gt; to &lt;CODE&gt;*&lt;/CODE&gt;. Give it a try!&lt;/P&gt;</description>
    <pubDate>Thu, 10 Dec 2015 01:06:22 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2015-12-10T01:06:22Z</dc:date>
    <item>
      <title>Conditionaly Change form input  variable value in the form search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditionaly-Change-form-input-variable-value-in-the-form-search/m-p/268609#M80791</link>
      <description>&lt;P&gt;I have a form that is doing SQL seach and Splunk Search using one veriable input text.  When I want to use a wild card  in the form I put in a "%" for SQL but this does not work for Splunk.  For splunk I need to use a "*".&lt;/P&gt;

&lt;P&gt;I tried using the eval with the if commend to change the wild card but this did not work&lt;/P&gt;

&lt;P&gt;useing:&lt;BR /&gt;
&amp;lt;input type="text" token="ip"&amp;gt;&lt;BR /&gt;
      &lt;LABEL&gt;IP Address&lt;/LABEL&gt;&lt;BR /&gt;
      &lt;DEFAULT&gt;&lt;/DEFAULT&gt;&lt;BR /&gt;
    &lt;/P&gt;

&lt;P&gt;Then puting in the wild card "%" in the form&lt;/P&gt;

&lt;P&gt;Then &lt;CODE&gt;| dbquery MVM "SELECT * from TABLE WHERE IP LIKE '%$ip$%'&lt;/CODE&gt;&lt;BR /&gt;&lt;BR /&gt;
the SQL search runes like this &lt;CODE&gt;| dbquery MVM "SELECT * from TABLE WHERE IP LIKE '%%%'&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Then &lt;CODE&gt;index=foo | eval ip=if(ip="%","*",ip) | search IP="*$ip$*"&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;the splunk search runes like this &lt;CODE&gt;index=foo | eval ip=if(ip="%","*",ip) | search IP="*%*"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;How can I convert the % to a * for the splunk search?&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 20:36:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditionaly-Change-form-input-variable-value-in-the-form-search/m-p/268609#M80791</guid>
      <dc:creator>hartfoml</dc:creator>
      <dc:date>2015-12-09T20:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Conditionaly Change form input  variable value in the form search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Conditionaly-Change-form-input-variable-value-in-the-form-search/m-p/268610#M80792</link>
      <description>&lt;P&gt;For your splunk search, have you tried &lt;CODE&gt;.. | where like(ip, $ip$)&lt;/CODE&gt;. With this approach, you will not have to change the &lt;CODE&gt;%&lt;/CODE&gt; to &lt;CODE&gt;*&lt;/CODE&gt;. Give it a try!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Dec 2015 01:06:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Conditionaly-Change-form-input-variable-value-in-the-form-search/m-p/268610#M80792</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2015-12-10T01:06:22Z</dc:date>
    </item>
  </channel>
</rss>

