<?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 add &amp;quot;LIKE&amp;quot; instead of &amp;quot;=&amp;quot; and add wildcard to search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-quot-LIKE-quot-instead-of-quot-quot-and-add-wildcard/m-p/254899#M76316</link>
    <description>&lt;P&gt;Like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbquery "routerdb" "SELECT DEVICE_LOC FROM routerdb.LKP_LOCATION_EDITED WHERE METRO_CITY LIKE '%Philadelphia%'" 
| stats count by DEVICE_LOC
| fields - count 
| eval ROUTER=DEVICE_LOC."%"
| fields ROUTER
| format
| eval search=replace(search, "=", " LIKE ")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 13 Jul 2016 19:47:43 GMT</pubDate>
    <dc:creator>sundareshr</dc:creator>
    <dc:date>2016-07-13T19:47:43Z</dc:date>
    <item>
      <title>How to add "LIKE" instead of "=" and add wildcard to search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-quot-LIKE-quot-instead-of-quot-quot-and-add-wildcard/m-p/254898#M76315</link>
      <description>&lt;PRE&gt;&lt;CODE&gt; &amp;lt;title&amp;gt;Routers&amp;lt;/title&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;| dbquery "routerdb" "SELECT DEVICE_LOC FROM routerdb.LKP_LOCATION_EDITED WHERE METRO_CITY LIKE '%Philadelphia%'"&lt;BR /&gt;&lt;BR /&gt;
               |  stats count by DEVICE_LOC&lt;BR /&gt;
               | fields - count &lt;BR /&gt;
               | rename DEVICE_LOC AS ROUTER&lt;BR /&gt;&lt;BR /&gt;
               |  format&lt;/P&gt;

&lt;P&gt;Outputs:    ( ( ROUTER="PHIL" ) OR ( ROUTER="PHL02" ) OR ( ROUTER="PHL23" ) OR ( ROUTER="PHL24" ) OR ( ROUTER="PHL6" ) OR ( ROUTER="PHL8" ) OR ( ROUTER="PHLAPA" ) )&lt;/P&gt;

&lt;P&gt;How would I make it so it would be like (ROUTER LIKE "PHIL%") with the "%" wildcard? I'm trying to use these router prefixes to find all routers with that prefix. Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 10:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-quot-LIKE-quot-instead-of-quot-quot-and-add-wildcard/m-p/254898#M76315</guid>
      <dc:creator>amandaxtru</dc:creator>
      <dc:date>2020-09-29T10:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to add "LIKE" instead of "=" and add wildcard to search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-add-quot-LIKE-quot-instead-of-quot-quot-and-add-wildcard/m-p/254899#M76316</link>
      <description>&lt;P&gt;Like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| dbquery "routerdb" "SELECT DEVICE_LOC FROM routerdb.LKP_LOCATION_EDITED WHERE METRO_CITY LIKE '%Philadelphia%'" 
| stats count by DEVICE_LOC
| fields - count 
| eval ROUTER=DEVICE_LOC."%"
| fields ROUTER
| format
| eval search=replace(search, "=", " LIKE ")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Jul 2016 19:47:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-add-quot-LIKE-quot-instead-of-quot-quot-and-add-wildcard/m-p/254899#M76316</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-13T19:47:43Z</dc:date>
    </item>
  </channel>
</rss>

