<?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 to use values in lookup table not as fields  but as search strings? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290583#M87823</link>
    <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup router_lookup | rename Router_Name as DEVICE_NAME Router_Interface as INTERFACE | eval Interface_Name=DEVICE_NAME." AND ".INTERFACE | fields Interface_Name | rename Interface_Name as query | format | rex field=search mode=sed "s/\"//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 22 Mar 2017 23:31:26 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-03-22T23:31:26Z</dc:date>
    <item>
      <title>How to use values in lookup table not as fields  but as search strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290580#M87820</link>
      <description>&lt;P&gt;Using lookup table to search events but having some issues:&lt;/P&gt;

&lt;P&gt;|inputlookup router_lookup | rename Router_Name as DEVICE_NAME Router_Interface as INTERFACE | fields DEVICE_NAME, INTERFACE | format&lt;/P&gt;

&lt;P&gt;results to:&lt;/P&gt;

&lt;P&gt;( ( DEVICE_NAME="ROUTERA" AND INTERFACE="xe-5/2/0" ) OR ( DEVICE_NAME="ROUTERB" AND INTERFACE="xe-9/3/1" ) OR ( DEVICE_NAME="ROUTERC" AND INTERFACE="xe-6/7/0" ) ... etc&lt;/P&gt;

&lt;P&gt;However, I found out that DEVICE_NAME is not a defined field for all routers, so I tried doing this:&lt;/P&gt;

&lt;P&gt;|inputlookup router_lookup | rename Router_Name as DEVICE_NAME Router_Interface as INTERFACE | eval Interface_Name=DEVICE_NAME." AND ".INTERFACE | fields Interface_Name | rename Interface_Name as query | format&lt;/P&gt;

&lt;P&gt;results to:&lt;/P&gt;

&lt;P&gt;( ("ROUTERA AND xe-5/2/0" ) OR ( "ROUTERB AND xe-9/3/1" ) OR ( "ROUTERC AND xe-6/7/0" ) ... etc&lt;/P&gt;

&lt;P&gt;this is NOT the result I was looking for since they have quotation marks.&lt;/P&gt;

&lt;P&gt;this is what I need:&lt;/P&gt;

&lt;P&gt;( (ROUTERA AND xe-5/2/0 ) OR (ROUTERB AND xe-9/3/1 ) OR (ROUTERC AND xe-6/7/0) ... etc&lt;/P&gt;

&lt;P&gt;thank you in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:22:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290580#M87820</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2020-09-29T13:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to use values in lookup table not as fields  but as search strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290581#M87821</link>
      <description>&lt;P&gt;Try this with your second search:&lt;/P&gt;

&lt;P&gt;| return $query | format&lt;/P&gt;

&lt;P&gt;But then simplify, you've got renames and such tht are really unnecessary.&lt;/P&gt;

&lt;P&gt;|inputlookup router_lookup &lt;BR /&gt;
| eval query=Router_Name." AND ".Router_Interface &lt;BR /&gt;
| fields query&lt;BR /&gt;
| return $query&lt;BR /&gt;
| format&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:22:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290581#M87821</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2020-09-29T13:22:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to use values in lookup table not as fields  but as search strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290582#M87822</link>
      <description>&lt;P&gt;Thank you for the response. Here is what I got using your suggestion:&lt;/P&gt;

&lt;P&gt;( ("ROUTERA AND xe-5/2/0" ))&lt;/P&gt;

&lt;P&gt;Returned only one item and did not remove the quotation marks. Removing the "| return $query" yields the same result as my second search.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2017 14:34:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290582#M87822</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2017-03-22T14:34:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to use values in lookup table not as fields  but as search strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290583#M87823</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|inputlookup router_lookup | rename Router_Name as DEVICE_NAME Router_Interface as INTERFACE | eval Interface_Name=DEVICE_NAME." AND ".INTERFACE | fields Interface_Name | rename Interface_Name as query | format | rex field=search mode=sed "s/\"//g"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Mar 2017 23:31:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290583#M87823</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-22T23:31:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to use values in lookup table not as fields  but as search strings?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290584#M87824</link>
      <description>&lt;P&gt;That worked, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2017 14:03:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-values-in-lookup-table-not-as-fields-but-as-search/m-p/290584#M87824</guid>
      <dc:creator>christopheryu</dc:creator>
      <dc:date>2017-03-23T14:03:55Z</dc:date>
    </item>
  </channel>
</rss>

