<?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: refine query to have a threshold in Other Usage</title>
    <link>https://community.splunk.com/t5/Other-Usage/Help-in-refining-query-to-have-a-threshold/m-p/584347#M1531</link>
    <description>&lt;P&gt;There are a couple of things&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;(a_location!=*S1* OR b_location!=*S1* OR c_location!=*S1* OR d_location!=*S1*) might not be doing what you think it is - when using inequalities you might want to change the ORs to ANDs&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;the mvexpand interface_card is unnecessary because the by clause on the stats command effectively does that&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Feb 2022 16:46:35 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-02-09T16:46:35Z</dc:date>
    <item>
      <title>Help in refining query to have a threshold</title>
      <link>https://community.splunk.com/t5/Other-Usage/Help-in-refining-query-to-have-a-threshold/m-p/584335#M1530</link>
      <description>&lt;P&gt;Hi Splunk Community,&amp;nbsp; I need some help with the following query:&lt;/P&gt;
&lt;P&gt;(index=* OR index=*) (sourcetype=A OR sourcetype=C OR sourcetype=D) (a_location=* OR b_location=* OR c_location=* OR d_location=*) (a_location!=*S1* OR b_location!=*S1* OR c_location!=*S1* OR d_location!=*S1*) User!=basketball UserGroup!=baseball | eval Interface_card=mvappend(a_location,b_location,c_location,d_location) | mvexpand Interface_card | bin span=1d _time | stats sum(TCDuration) as TCDuration by _time Interface_card | eval TCDuration=TCDuration/1000 | eval Utilization=round(((TCDuration/86400)*100),1) | eval Utilization=if(Utilization &amp;gt;100, 100, Utilization) | fields - TCDuration | timechart eval(round(avg(Utilization),1)) by Interface_card limit=0&lt;/P&gt;
&lt;P&gt;1. How can I optimized it&lt;/P&gt;
&lt;P&gt;2. how can I filter only Utilization between 0-40 and/or 70-99 or any other limit I want to filter...&lt;/P&gt;
&lt;P&gt;Appreciate any help&lt;/P&gt;
&lt;P&gt;thank you&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 19:00:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Help-in-refining-query-to-have-a-threshold/m-p/584335#M1530</guid>
      <dc:creator>jaydiare</dc:creator>
      <dc:date>2022-02-09T19:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: refine query to have a threshold</title>
      <link>https://community.splunk.com/t5/Other-Usage/Help-in-refining-query-to-have-a-threshold/m-p/584347#M1531</link>
      <description>&lt;P&gt;There are a couple of things&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;(a_location!=*S1* OR b_location!=*S1* OR c_location!=*S1* OR d_location!=*S1*) might not be doing what you think it is - when using inequalities you might want to change the ORs to ANDs&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="lia-indent-padding-left-30px"&gt;&lt;SPAN&gt;the mvexpand interface_card is unnecessary because the by clause on the stats command effectively does that&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 16:46:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Help-in-refining-query-to-have-a-threshold/m-p/584347#M1531</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-02-09T16:46:35Z</dc:date>
    </item>
    <item>
      <title>Re: refine query to have a threshold</title>
      <link>https://community.splunk.com/t5/Other-Usage/Help-in-refining-query-to-have-a-threshold/m-p/584358#M1532</link>
      <description>&lt;P&gt;1. "index=* OR index=*"? You were generating it somehow? Limit your search to appropriate indexes.&lt;/P&gt;&lt;P&gt;2. You have many "left wildcard" conditions - conditions in which fields start with an asterisk. It is highly inefficient since splunk needs to read whole events.&lt;/P&gt;&lt;P&gt;3. You have a condition matching "a_location=* OR b_location=* OR c_location=* OR d_location=*" which, depending on your data, will most probably match all your events (or at least a very significant subset of them) so it's not very effectiv. Furthermore, next composite condition is (a_location!=*S1* OR b_location!=*S1* OR c_location!=*S1* OR d_location!=*S1*) which will again most probably match most of your events.&lt;/P&gt;&lt;P&gt;4. eval Interface_card=mvappend(a_location,b_location,c_location,d_location) | mvexpand Interface_card - interesting approach but firstly drop the fields you won't be needing later so you lower the memory footprint&lt;/P&gt;&lt;P&gt;5. If you want to filter your results, you can simply add&lt;/P&gt;&lt;PRE&gt;| search Utilization&amp;lt;A Utilization&amp;gt;B&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;or&lt;/P&gt;&lt;PRE&gt;| where Utilization&amp;gt;C AND Utilization&amp;lt;D&lt;/PRE&gt;&lt;P&gt;(In this case - if you want to limit by constant values - they will both work. In general case - these are differently working commands and you cannot simply substitute one for another)&lt;/P&gt;</description>
      <pubDate>Wed, 09 Feb 2022 17:59:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Other-Usage/Help-in-refining-query-to-have-a-threshold/m-p/584358#M1532</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2022-02-09T17:59:38Z</dc:date>
    </item>
  </channel>
</rss>

