<?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 Using variable in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-variable/m-p/165898#M47177</link>
    <description>&lt;P&gt;My search string is &lt;BR /&gt;
(host=ABC AND "Emp Code"=inputString) OR (host=joinHost AND "EMPLOYER_CODE"=inputString)&lt;BR /&gt;
Can I have a common varible in place of inputString.&lt;/P&gt;

&lt;P&gt;I tried using using eval like below.&lt;BR /&gt;
eval inupt=inputString|(host=ABC AND "Emp Code"=inputString) OR (host=joinHost AND "EMPLOYER_CODE"=inputString)&lt;BR /&gt;
But not getting result.&lt;/P&gt;

&lt;P&gt;Any help&lt;/P&gt;</description>
    <pubDate>Wed, 26 Feb 2014 09:12:14 GMT</pubDate>
    <dc:creator>jimjohn</dc:creator>
    <dc:date>2014-02-26T09:12:14Z</dc:date>
    <item>
      <title>Using variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-variable/m-p/165898#M47177</link>
      <description>&lt;P&gt;My search string is &lt;BR /&gt;
(host=ABC AND "Emp Code"=inputString) OR (host=joinHost AND "EMPLOYER_CODE"=inputString)&lt;BR /&gt;
Can I have a common varible in place of inputString.&lt;/P&gt;

&lt;P&gt;I tried using using eval like below.&lt;BR /&gt;
eval inupt=inputString|(host=ABC AND "Emp Code"=inputString) OR (host=joinHost AND "EMPLOYER_CODE"=inputString)&lt;BR /&gt;
But not getting result.&lt;/P&gt;

&lt;P&gt;Any help&lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2014 09:12:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-variable/m-p/165898#M47177</guid>
      <dc:creator>jimjohn</dc:creator>
      <dc:date>2014-02-26T09:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using variable</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-variable/m-p/165899#M47178</link>
      <description>&lt;P&gt;No, not the way you describe it. &lt;/P&gt;

&lt;P&gt;You cannot start with an &lt;CODE&gt;eval&lt;/CODE&gt; that way. You might get away with something like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=ABC OR host=joinHost inputString | blah blah blah
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which will search through the events for &lt;CODE&gt;inputString&lt;/CODE&gt;, regardless of whether it appears in a field or not. But since &lt;CODE&gt;inputString&lt;/CODE&gt; is treated as a literal string, rather than a field value, your search may return results where &lt;CODE&gt;inputString&lt;/CODE&gt; is present in other parts of the event.&lt;/P&gt;

&lt;P&gt;/k &lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2014 09:46:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-variable/m-p/165899#M47178</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2014-02-26T09:46:27Z</dc:date>
    </item>
  </channel>
</rss>

