<?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 How to search multiple values using wildcard in a field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595826#M207393</link>
    <description>&lt;P&gt;I am producing some stats in splunk but I want to extract data for about 10&amp;nbsp;uri_method instead of 100s currently displayed in the table. The last line is where I am getting stuck. I want to be able to search&amp;nbsp;uri_method for multiple values with wildcard.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e. the following should be returned&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.example.com/v2/customers/*" target="_blank" rel="noopener"&gt;www.example.com/v2/customers/*&lt;/A&gt; (HEAD)&lt;/P&gt;
&lt;P&gt;example.co.uk/v1/orders/* (HEAD)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.example.com/xy/customers/*" target="_blank" rel="noopener"&gt;www.example.com/xy/customers/*&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.abc.com/v3/customers" target="_blank" rel="noopener"&gt;www.abc.com/v3/customers&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.GetOrder.com/v2/orders/*" target="_blank" rel="noopener"&gt;www.GetOrder.com/v2/orders/*&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ListOrders.com/v2/orders" target="_blank" rel="noopener"&gt;www.ListOrders.com/v2/orders&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ListAddresses.com/xy/customers/*/addresses" target="_blank" rel="noopener"&gt;www.ListAddresses.com/xy/customers/*/addresses&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;BUT NOT:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.example.com/xy/customers/*/details" target="_blank" rel="noopener"&gt;www.example.com/xy/customers/*/details&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.GetOrder.com/v2/orders/*/shipping/*" target="_blank" rel="noopener"&gt;www.GetOrder.com/v2/orders/*/shipping/*&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.GetOrder.com/v2/orders/*/returns/*" target="_blank" rel="noopener"&gt;www.GetOrder.com/v2/orders/*/returns/*&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I remove the where clause(last line), I get 100s of results. I want to list only some items(uri_method) that &lt;STRONG&gt;end with&lt;/STRONG&gt;&amp;nbsp;"customers/* (HEAD)", "orders/* (HEAD)",&amp;nbsp;"customers/* (GET)", "customers (GET)", "orders (GET)","orders/* (GET)", "addresses (GET)" etc.&lt;/P&gt;
&lt;P&gt;If I use Where clause with field name "IN", the wildcard * is not considered. If I use LIKE, I'm not sure how to add multiple values to where clause. Please help.&lt;/P&gt;
&lt;P&gt;index=main env=test ("*Method=GET*" OR "*Method=HEAD*") "StatusCode=200"&lt;BR /&gt;| rex field=log "ResponseTime=(?&amp;lt;ResponseTime&amp;gt;\d+)"&lt;BR /&gt;| rex field=log "StatusCode=(?&amp;lt;StatusCode&amp;gt;\d+)"&lt;BR /&gt;| rex field=log "\"?Method\"?\=(?&amp;lt;Method&amp;gt;[^,]*)"&lt;BR /&gt;| rex field=log "Uri=(?&amp;lt;uri&amp;gt;[^\,?]+)"&lt;BR /&gt;| rex field=uri "uri=(?&amp;lt;uri&amp;gt;[?].*)"&lt;BR /&gt;| eval uri = urldecode(uri)&lt;BR /&gt;| eval uri = replace(uri, "/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}","/*")&lt;BR /&gt;| eval uri = replace(uri, "(\/[0-9]+)", "/*")&lt;BR /&gt;| eval uri_method = uri + " (" + Method + ")"&lt;BR /&gt;| stats perc95(ResponseTime) as response, count as request_rate by uri_method, StatusCode&lt;BR /&gt;| eval score = toNumber(response) * toNumber(request_rate)&lt;BR /&gt;| sort -score&lt;BR /&gt;| table uri_method,StatusCode,response,request_rate ,score&lt;BR /&gt;| where uri_method IN ("*customers/* (HEAD)","*orders/* (HEAD)",&amp;nbsp; "*users/* (HEAD)", "*customers/* (GET)", "*customers (GET)", "*orders (GET)","*orders/* (GET)", "*addresses (GET)")&lt;/P&gt;</description>
    <pubDate>Thu, 28 Apr 2022 20:50:43 GMT</pubDate>
    <dc:creator>nbhat</dc:creator>
    <dc:date>2022-04-28T20:50:43Z</dc:date>
    <item>
      <title>How to search multiple values using wildcard in a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595826#M207393</link>
      <description>&lt;P&gt;I am producing some stats in splunk but I want to extract data for about 10&amp;nbsp;uri_method instead of 100s currently displayed in the table. The last line is where I am getting stuck. I want to be able to search&amp;nbsp;uri_method for multiple values with wildcard.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i.e. the following should be returned&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.example.com/v2/customers/*" target="_blank" rel="noopener"&gt;www.example.com/v2/customers/*&lt;/A&gt; (HEAD)&lt;/P&gt;
&lt;P&gt;example.co.uk/v1/orders/* (HEAD)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.example.com/xy/customers/*" target="_blank" rel="noopener"&gt;www.example.com/xy/customers/*&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.abc.com/v3/customers" target="_blank" rel="noopener"&gt;www.abc.com/v3/customers&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.GetOrder.com/v2/orders/*" target="_blank" rel="noopener"&gt;www.GetOrder.com/v2/orders/*&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ListOrders.com/v2/orders" target="_blank" rel="noopener"&gt;www.ListOrders.com/v2/orders&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ListAddresses.com/xy/customers/*/addresses" target="_blank" rel="noopener"&gt;www.ListAddresses.com/xy/customers/*/addresses&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;BUT NOT:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.example.com/xy/customers/*/details" target="_blank" rel="noopener"&gt;www.example.com/xy/customers/*/details&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.GetOrder.com/v2/orders/*/shipping/*" target="_blank" rel="noopener"&gt;www.GetOrder.com/v2/orders/*/shipping/*&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.GetOrder.com/v2/orders/*/returns/*" target="_blank" rel="noopener"&gt;www.GetOrder.com/v2/orders/*/returns/*&lt;/A&gt; (GET)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I remove the where clause(last line), I get 100s of results. I want to list only some items(uri_method) that &lt;STRONG&gt;end with&lt;/STRONG&gt;&amp;nbsp;"customers/* (HEAD)", "orders/* (HEAD)",&amp;nbsp;"customers/* (GET)", "customers (GET)", "orders (GET)","orders/* (GET)", "addresses (GET)" etc.&lt;/P&gt;
&lt;P&gt;If I use Where clause with field name "IN", the wildcard * is not considered. If I use LIKE, I'm not sure how to add multiple values to where clause. Please help.&lt;/P&gt;
&lt;P&gt;index=main env=test ("*Method=GET*" OR "*Method=HEAD*") "StatusCode=200"&lt;BR /&gt;| rex field=log "ResponseTime=(?&amp;lt;ResponseTime&amp;gt;\d+)"&lt;BR /&gt;| rex field=log "StatusCode=(?&amp;lt;StatusCode&amp;gt;\d+)"&lt;BR /&gt;| rex field=log "\"?Method\"?\=(?&amp;lt;Method&amp;gt;[^,]*)"&lt;BR /&gt;| rex field=log "Uri=(?&amp;lt;uri&amp;gt;[^\,?]+)"&lt;BR /&gt;| rex field=uri "uri=(?&amp;lt;uri&amp;gt;[?].*)"&lt;BR /&gt;| eval uri = urldecode(uri)&lt;BR /&gt;| eval uri = replace(uri, "/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}","/*")&lt;BR /&gt;| eval uri = replace(uri, "(\/[0-9]+)", "/*")&lt;BR /&gt;| eval uri_method = uri + " (" + Method + ")"&lt;BR /&gt;| stats perc95(ResponseTime) as response, count as request_rate by uri_method, StatusCode&lt;BR /&gt;| eval score = toNumber(response) * toNumber(request_rate)&lt;BR /&gt;| sort -score&lt;BR /&gt;| table uri_method,StatusCode,response,request_rate ,score&lt;BR /&gt;| where uri_method IN ("*customers/* (HEAD)","*orders/* (HEAD)",&amp;nbsp; "*users/* (HEAD)", "*customers/* (GET)", "*customers (GET)", "*orders (GET)","*orders/* (GET)", "*addresses (GET)")&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 20:50:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595826#M207393</guid>
      <dc:creator>nbhat</dc:creator>
      <dc:date>2022-04-28T20:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Search multiple values using wildcard in a Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595831#M207394</link>
      <description>&lt;LI-CODE lang="markup"&gt;| where match(uri_method ,"\/customers/\* \(HEAD\)") OR match(uri_method ,"\/orders\/\* \(HEAD\)") OR match(uri_method ,"\/users\/\* \(HEAD\)") OR match(uri_method ,"\/customers\/\* \(GET\)") OR match(uri_method ,"\/customers \(GET\)") OR match(uri_method ,"\/orders \(GET\)") OR match(uri_method ,"\/orders\/\* \(GET\)") OR match(uri_method ,"\/addresses \(GET\)")&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Apr 2022 17:28:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595831#M207394</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-28T17:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Search multiple values using wildcard in a Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595832#M207395</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/242375"&gt;@nbhat&lt;/a&gt;&amp;nbsp;- You can use the &lt;STRONG&gt;search&lt;/STRONG&gt; command as well, which is what you are currently using syntax for.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search uri_method IN ("*customers/* (HEAD)","*orders/* (HEAD)",  "*users/* (HEAD)", "*customers/* (GET)", "*customers (GET)", "*orders (GET)","*orders/* (GET)", "*addresses (GET)")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!!!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 17:34:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595832#M207395</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-04-28T17:34:45Z</dc:date>
    </item>
    <item>
      <title>Re: Search multiple values using wildcard in a Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595835#M207397</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/93915"&gt;@VatsalJagani&lt;/a&gt;&amp;nbsp;This doesn't eliminate the last 3 as they still match against "customer/* (GET)" or "orders/* (GET)" when search is used&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 17:44:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595835#M207397</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-04-28T17:44:10Z</dc:date>
    </item>
    <item>
      <title>Re: Search multiple values using wildcard in a Field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595837#M207398</link>
      <description>&lt;P&gt;Ohh I see that makes sense!! It took me 2 min to understand this because I missed that part from the question.&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":raising_hands:"&gt;🙌&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;span class="lia-unicode-emoji" title=":raising_hands:"&gt;🙌&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Thanks!!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Apr 2022 17:54:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-multiple-values-using-wildcard-in-a-field/m-p/595837#M207398</guid>
      <dc:creator>VatsalJagani</dc:creator>
      <dc:date>2022-04-28T17:54:58Z</dc:date>
    </item>
  </channel>
</rss>

