<?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 where clause with table containing fields within quotes in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-where-clause-with-table-containing-fields-within/m-p/523536#M88402</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; Thanks, this works&lt;/P&gt;</description>
    <pubDate>Wed, 07 Oct 2020 21:29:58 GMT</pubDate>
    <dc:creator>nits</dc:creator>
    <dc:date>2020-10-07T21:29:58Z</dc:date>
    <item>
      <title>How to use where clause with table containing fields within quotes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-where-clause-with-table-containing-fields-within/m-p/522749#M88287</link>
      <description>&lt;P&gt;I have a query which looks like:&lt;BR /&gt;index=test "TestRequest" | dedup _time | rex field=_raw "Price\":(?&amp;lt;price&amp;gt;.*?)," | rex field=_raw REQUEST-ID=(?&amp;lt;REQID&amp;gt;.*?)\s | rex field=_raw "Amount\":(?&amp;lt;amount&amp;gt;.*?)}," | rex field=_raw "ItemId\":\"(?&amp;lt;itemId&amp;gt;.*?)\"}" | eval discount=round(exact(price-amount),2) , percent=(discount/price)*100&lt;BR /&gt;, time=strftime(_time, "%m-%d-%y %H:%M:%S") | stats list(time) as Time list(itemId) as "Item" list(REQID) as X-REQUEST-ID list(price) as "Original Price" list(amount) as "Test Price" list(discount) as "Dollar Discount" list(percent) as "Percent Override" by _time&lt;BR /&gt;[search index=test "UserId=" | rex field=_raw UserId=(?&amp;lt;userId&amp;gt;.*?)# | dedup userId | rex field=_raw X-REQUEST-ID=(?&amp;lt;REQID&amp;gt;.*?)\s | stats list(userId) as "User ID" list(REQID) as X-REQUEST-ID by _time]&lt;BR /&gt;| where "Dollar Discount"&amp;gt;=500.00 OR "Percent Override"&amp;gt;=50.00&lt;BR /&gt;| table&amp;nbsp; "User ID" Item "Original Price" "Dollar Discount" "Test Price" "Percent Override" Time&lt;BR /&gt;&lt;BR /&gt;This query throws error as mismatch type for&amp;nbsp;"Dollar Discount"&amp;gt;=500.00 OR "Percent Override"&amp;gt;=50.00&lt;BR /&gt;Since my fields in the table have "" e.g.&amp;nbsp;"Dollar Discount" or&amp;nbsp;"Percent Override", it doesn't work. If i replace these fields names without quotes as&amp;nbsp;Dollar_Discount and&amp;nbsp;Percent_Override, it works fine.&lt;BR /&gt;how to use a table field with name listed in quotes in where clause?&lt;/P&gt;</description>
      <pubDate>Fri, 02 Oct 2020 20:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-where-clause-with-table-containing-fields-within/m-p/522749#M88287</guid>
      <dc:creator>nits</dc:creator>
      <dc:date>2020-10-02T20:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use where clause with table containing fields within quotes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-where-clause-with-table-containing-fields-within/m-p/522752#M88288</link>
      <description>&lt;P&gt;Try using single quotes for fields in where clauses&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=test "TestRequest" | dedup _time | rex field=_raw "Price\":(?&amp;lt;price&amp;gt;.*?)," | rex field=_raw REQUEST-ID=(?&amp;lt;REQID&amp;gt;.*?)\s | rex field=_raw "Amount\":(?&amp;lt;amount&amp;gt;.*?)}," | rex field=_raw "ItemId\":\"(?&amp;lt;itemId&amp;gt;.*?)\"}" | eval discount=round(exact(price-amount),2) , percent=(discount/price)*100
, time=strftime(_time, "%m-%d-%y %H:%M:%S") | stats list(time) as Time list(itemId) as "Item" list(REQID) as X-REQUEST-ID list(price) as "Original Price" list(amount) as "Test Price" list(discount) as "Dollar Discount" list(percent) as "Percent Override" by _time
[search index=test "UserId=" | rex field=_raw UserId=(?&amp;lt;userId&amp;gt;.*?)# | dedup userId | rex field=_raw X-REQUEST-ID=(?&amp;lt;REQID&amp;gt;.*?)\s | stats list(userId) as "User ID" list(REQID) as X-REQUEST-ID by _time]
| where 'Dollar Discount'&amp;gt;=500.00 OR 'Percent Override'&amp;gt;=50.00
| table  "User ID" Item "Original Price" "Dollar Discount" "Test Price" "Percent Override" Time&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Oct 2020 21:28:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-where-clause-with-table-containing-fields-within/m-p/522752#M88288</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-02T21:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use where clause with table containing fields within quotes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-where-clause-with-table-containing-fields-within/m-p/523536#M88402</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; Thanks, this works&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 21:29:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-where-clause-with-table-containing-fields-within/m-p/523536#M88402</guid>
      <dc:creator>nits</dc:creator>
      <dc:date>2020-10-07T21:29:58Z</dc:date>
    </item>
  </channel>
</rss>

