<?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 do I use a value of an eval field to search an existing field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-value-of-an-eval-field-to-search-an-existing/m-p/266666#M80157</link>
    <description>&lt;P&gt;That worked like a charm :). Thanks a lot.&lt;/P&gt;</description>
    <pubDate>Thu, 31 Mar 2016 14:11:49 GMT</pubDate>
    <dc:creator>apvinod2003</dc:creator>
    <dc:date>2016-03-31T14:11:49Z</dc:date>
    <item>
      <title>How do I use a value of an eval field to search an existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-value-of-an-eval-field-to-search-an-existing/m-p/266664#M80155</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;

&lt;P&gt;I have an input token $env_field$ which has a value: "port123_host123"&lt;BR /&gt;
host, component and port  are existing fields in splunk&lt;/P&gt;

&lt;P&gt;I have a search that goes as follows: (basically need to extract the port from input token and use that value to search on the port field)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host=host123 component=cmp123| eval prtInput= replace($env_field$, "([^_]+)\_\w*", "\1")  | search port=prtInput
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But this doesn't work. Eval expression is working, i.e., &lt;CODE&gt;prtInput&lt;/CODE&gt; gets evaluated as "port123" and available as a field in the search result; I checked. But the &lt;CODE&gt;search port=prtInput&lt;/CODE&gt; portion isn't returning any results somehow. &lt;CODE&gt;search port=port123&lt;/CODE&gt; returns results however.&lt;/P&gt;

&lt;P&gt;Can't we use a value from eval field piped into a search command? If not, what alternatives do we have to achieve this?&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
Vinod.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 09:14:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-value-of-an-eval-field-to-search-an-existing/m-p/266664#M80155</guid>
      <dc:creator>apvinod2003</dc:creator>
      <dc:date>2020-09-29T09:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a value of an eval field to search an existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-value-of-an-eval-field-to-search-an-existing/m-p/266665#M80156</link>
      <description>&lt;P&gt;Change:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| search port=prtInput
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;to&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where port==prtInput
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 31 Mar 2016 13:58:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-value-of-an-eval-field-to-search-an-existing/m-p/266665#M80156</guid>
      <dc:creator>jacobwilkins</dc:creator>
      <dc:date>2016-03-31T13:58:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a value of an eval field to search an existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-value-of-an-eval-field-to-search-an-existing/m-p/266666#M80157</link>
      <description>&lt;P&gt;That worked like a charm :). Thanks a lot.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 14:11:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-value-of-an-eval-field-to-search-an-existing/m-p/266666#M80157</guid>
      <dc:creator>apvinod2003</dc:creator>
      <dc:date>2016-03-31T14:11:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use a value of an eval field to search an existing field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-value-of-an-eval-field-to-search-an-existing/m-p/266667#M80158</link>
      <description>&lt;P&gt;Tried to find some related threads such as &lt;A href="https://answers.splunk.com/answers/50659/whats-the-difference-between-where-and-search-in-the-pipeline.html"&gt;https://answers.splunk.com/answers/50659/whats-the-difference-between-where-and-search-in-the-pipeline.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Mar 2016 14:38:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-use-a-value-of-an-eval-field-to-search-an-existing/m-p/266667#M80158</guid>
      <dc:creator>ddrillic</dc:creator>
      <dc:date>2016-03-31T14:38:11Z</dc:date>
    </item>
  </channel>
</rss>

