<?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: Using like() not working in where statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-like-not-working-in-where-statement/m-p/549693#M155993</link>
    <description>&lt;P&gt;I was able to solve this by putting the condition in the first line of the search, like this:&lt;BR /&gt;&lt;BR /&gt;index=alerts data.rule.name="Target Trends, Trending Targets in Watch List"&lt;BR /&gt;&lt;BR /&gt;It still bugs me that&lt;BR /&gt;&lt;BR /&gt;| where like()&lt;BR /&gt;&lt;BR /&gt;isn't working the way I'd expect it to, if anyone has advice I am all ears!&lt;/P&gt;</description>
    <pubDate>Wed, 28 Apr 2021 21:29:09 GMT</pubDate>
    <dc:creator>bpna</dc:creator>
    <dc:date>2021-04-28T21:29:09Z</dc:date>
    <item>
      <title>Using like() not working in where statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-like-not-working-in-where-statement/m-p/549690#M155992</link>
      <description>&lt;P&gt;I have an alerts index which has a data.rule.name field containing the following values:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://splunk-ps-alerttesting-01.recfut.com:8000/en-US/app/TA-recordedfuture/search?q=search%20index%3Dalerts%0A%7C%20fields%20*&amp;amp;display.page.search.mode=smart&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-60m%40m&amp;amp;latest=now&amp;amp;sid=1619644461.2121#" target="_blank" rel="noopener"&gt;COVID-19 linked Cyber Attacks (Social Media)&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;40%&lt;/TD&gt;&lt;TD&gt;&lt;DIV class="graph-bar"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://splunk-ps-alerttesting-01.recfut.com:8000/en-US/app/TA-recordedfuture/search?q=search%20index%3Dalerts%0A%7C%20fields%20*&amp;amp;display.page.search.mode=smart&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-60m%40m&amp;amp;latest=now&amp;amp;sid=1619644461.2121#" target="_blank" rel="noopener"&gt;Global Trends, Trending Targets&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20%&lt;/TD&gt;&lt;TD&gt;&lt;DIV class="graph-bar"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://splunk-ps-alerttesting-01.recfut.com:8000/en-US/app/TA-recordedfuture/search?q=search%20index%3Dalerts%0A%7C%20fields%20*&amp;amp;display.page.search.mode=smart&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-60m%40m&amp;amp;latest=now&amp;amp;sid=1619644461.2121#" target="_blank" rel="noopener"&gt;Locations by Risk Level&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20%&lt;/TD&gt;&lt;TD&gt;&lt;DIV class="graph-bar"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;A href="https://splunk-ps-alerttesting-01.recfut.com:8000/en-US/app/TA-recordedfuture/search?q=search%20index%3Dalerts%0A%7C%20fields%20*&amp;amp;display.page.search.mode=smart&amp;amp;dispatch.sample_ratio=1&amp;amp;workload_pool=&amp;amp;earliest=-60m%40m&amp;amp;latest=now&amp;amp;sid=1619644461.2121#" target="_blank" rel="noopener"&gt;Target Trends, Trending Targets in Watch List&lt;/A&gt;&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;20%&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to filter events to only include ones where data.rule.name begins with "Target Trends..."&lt;BR /&gt;&lt;BR /&gt;My SPL is as follows:&lt;BR /&gt;&lt;BR /&gt;index=alerts&lt;BR /&gt;| where like(data.rule.name, "Target Trends.%")&lt;BR /&gt;&lt;BR /&gt;This produces 0 events. Am I using this function wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 21:20:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-like-not-working-in-where-statement/m-p/549690#M155992</guid>
      <dc:creator>bpna</dc:creator>
      <dc:date>2021-04-28T21:20:12Z</dc:date>
    </item>
    <item>
      <title>Re: Using like() not working in where statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-like-not-working-in-where-statement/m-p/549693#M155993</link>
      <description>&lt;P&gt;I was able to solve this by putting the condition in the first line of the search, like this:&lt;BR /&gt;&lt;BR /&gt;index=alerts data.rule.name="Target Trends, Trending Targets in Watch List"&lt;BR /&gt;&lt;BR /&gt;It still bugs me that&lt;BR /&gt;&lt;BR /&gt;| where like()&lt;BR /&gt;&lt;BR /&gt;isn't working the way I'd expect it to, if anyone has advice I am all ears!&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 21:29:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-like-not-working-in-where-statement/m-p/549693#M155993</guid>
      <dc:creator>bpna</dc:creator>
      <dc:date>2021-04-28T21:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Using like() not working in where statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-like-not-working-in-where-statement/m-p/549696#M155995</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233957"&gt;@bpna&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When using field names in statements that take an eval expression, like the where clause does, you will need to escape fields that do not contain 'simple' characters. In practice this means that any field starting with a numeric, or not contain only numbers and letters will need to be escaped by wrapping the field in single quotes, e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| where like('data.rule.name', "Target Trends.%")&lt;/LI-CODE&gt;&lt;P&gt;in this case, the . character needs to be escaped. See these links for a description (although they are SLP2, they apply here also)&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SCS/current/Search/Escapecharacters#Rules_for_when_to_use_escape_characters" target="_blank"&gt;https://docs.splunk.com/Documentation/SCS/current/Search/Escapecharacters#Rules_for_when_to_use_escape_characters&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/SCS/current/Search/Quotations" target="_blank"&gt;https://docs.splunk.com/Documentation/SCS/current/Search/Quotations&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Apr 2021 22:28:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-like-not-working-in-where-statement/m-p/549696#M155995</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-04-28T22:28:07Z</dc:date>
    </item>
  </channel>
</rss>

