<?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 give threshold  values dynamically in the search query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-give-threshold-values-dynamically-in-the-search-query/m-p/190478#M54854</link>
    <description>&lt;P&gt;Add a &lt;CODE&gt;case&lt;/CODE&gt; statement like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval thresholdValue=case(tier="tier1", 70, tier="tier2", 80 , tier="tier3", 90, true(), 0) | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So it would be like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="C:Network Analysistier1rusxwalmartedc S0-0-0.csv" OR source="C:Network Analysistier1rdinmumbai010-7-1 S2-0.csv" OR source="C:Network Analysistier1rdgbreddit010-1-2 Gig0-2.csv" OR source="C:Network Analysistier2rdingurgao010-5-1 f0-1.csv" OR source="C:Network Analysistier3rdinsecund010-5-2 Gig0-0.csv" OR source="C:Network Analysistier2rdphcebu010-5-1 f0-2-0.csv"host="SEZ00VVM-153" sourcetype="csv" | rex field=source "(?&amp;lt;country&amp;gt;.*?)$"|lookup datacentre.csv country OUTPUT receivebandwidth sitename tier|search tier=tier1|eval Intraffic=IN/1048576 |eval Outtraffic=Out/1048576|eval result=(Intraffic)+(Outtraffic)|eval seventyperc= receivebandwidth*0.7 |eval eightyperc=receivebandwidth*0.8 |eval nightyperc=receivebandwidth*0.9 | eval thresholdValue=case(tier="tier1", 70, tier="tier2", 80 , tier="tier3", 90, true(), 0) | where result&amp;gt;thresholdValue |stats Values(result) AS Inout,values(seventyperc) AS 70%,Values(eightyperc) AS 80%,values(nightyperc) AS 90%,values(receivebandwidth) as 100% count as nc by sitename _time |bin _time span=1d|stats sum(nc) as NOC by sitename _time|eval NOH =NOC*5/60|timechart span=1d values(NOH) AS total by sitename
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 27 Aug 2015 13:35:30 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-08-27T13:35:30Z</dc:date>
    <item>
      <title>How to give threshold  values dynamically in the search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-give-threshold-values-dynamically-in-the-search-query/m-p/190476#M54852</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;

&lt;P&gt;I have got different sites seperated according to the tiers having different threshold values&lt;BR /&gt;
Ex&lt;BR /&gt;&lt;BR /&gt;
Mumbai-Tier1&lt;/P&gt;

&lt;P&gt;Cebu Tier2 &lt;BR /&gt;
Gurgoan tier2&lt;/P&gt;

&lt;P&gt;Hyderabad Tier 3&lt;/P&gt;

&lt;P&gt;Tier threshold valu=70%&lt;BR /&gt;
Tier threshold value=80%&lt;BR /&gt;
Tier 3 threshold valu=90%&lt;/P&gt;

&lt;P&gt;Right now i have a combo box from whihc i can select a tier and my chart will   display graphs for sites in that tier &lt;BR /&gt;
but now i want how many sites network consumption is excedding particaular threshold how can i change according to the tier selected&lt;/P&gt;

&lt;P&gt;Here is search query where i want to change my threshold according to the tier slected in the combo box&lt;/P&gt;

&lt;P&gt;source="C:\Network Analysis\tier1\rusxwalmartedc S0-0-0.csv" OR source="C:\Network Analysis\tier1\rdinmumbai010-7-1 S2-0.csv" OR  source="C:\Network Analysis\tier1\rdgbreddit010-1-2 Gig0-2.csv" OR source="C:\Network Analysis\tier2\rdingurgao010-5-1 f0-1.csv" OR source="C:\Network Analysis\tier3\rdinsecund010-5-2 Gig0-0.csv" OR source="C:\Network Analysis\tier2\rdphcebu010-5-1 f0-2-0.csv"host="SEZ00VVM-153"   sourcetype="csv" | rex field=source "(?&amp;lt;country&amp;gt;.&lt;EM&gt;?)$"|lookup datacentre.csv country OUTPUT  receivebandwidth sitename tier|search tier=tier1|eval Intraffic=IN/1048576 |eval Outtraffic=Out/1048576|eval result=(Intraffic)+(Outtraffic)|eval seventyperc= receivebandwidth*0.7 |eval eightyperc=receivebandwidth*0.8  |eval  nightyperc=receivebandwidth*0.9|&lt;/EM&gt;&lt;EM&gt;where result&amp;gt;seventyperc&lt;/EM&gt;*|stats Values(result) AS Inout,values(seventyperc) AS 70%,Values(eightyperc) AS 80%,values(nightyperc) AS 90%,values(receivebandwidth) as 100%  count as nc by sitename  _time  |bin _time span=1d|stats sum(nc) as NOC by sitename _time|eval NOH =NOC*5/60|timechart span=1d values(NOH) AS total by sitename&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 07:06:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-give-threshold-values-dynamically-in-the-search-query/m-p/190476#M54852</guid>
      <dc:creator>deepthi5</dc:creator>
      <dc:date>2020-09-29T07:06:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to give threshold  values dynamically in the search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-give-threshold-values-dynamically-in-the-search-query/m-p/190477#M54853</link>
      <description>&lt;P&gt;Hi deepthi5,&lt;/P&gt;

&lt;P&gt;I believe what you're looking for is the ability to define new tokens based on the conditional input choices.  The Splunk documentation has a good example here:&lt;BR /&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.5/Viz/PanelreferenceforSimplifiedXML#condition_.28input.29"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.5/Viz/PanelreferenceforSimplifiedXML#condition_.28input.29&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Here's a run anywhere example also...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;Language&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="radio" token="myChoice" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Language Choice&amp;lt;/label&amp;gt;
      &amp;lt;choice value="lang1"&amp;gt;English&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="lang2"&amp;gt;Spanish&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="lang3"&amp;gt;French&amp;lt;/choice&amp;gt;
      &amp;lt;change&amp;gt;
        &amp;lt;condition label="English"&amp;gt;
          &amp;lt;set token="myConditionalChoice"&amp;gt;"Hello, world"&amp;lt;/set&amp;gt;
          &amp;lt;set token="mylang"&amp;gt;English&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition label="Spanish"&amp;gt;
          &amp;lt;set token="myConditionalChoice"&amp;gt;"Hola mundo"&amp;lt;/set&amp;gt;
          &amp;lt;set token="mylang"&amp;gt;Espagnol&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
        &amp;lt;condition value="lang3"&amp;gt;
          &amp;lt;set token="myConditionalChoice"&amp;gt;"Bonjour le monde"&amp;lt;/set&amp;gt;
          &amp;lt;set token="mylang"&amp;gt;Français&amp;lt;/set&amp;gt;
        &amp;lt;/condition&amp;gt;
      &amp;lt;/change&amp;gt;
      &amp;lt;default&amp;gt;lang1&amp;lt;/default&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;
          | stats count |eval greeting=$myConditionalChoice|s$ | eval out = "$mylang$" . ": " . greeting | fields out
         &amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hopefully, you'll be able use these example to modify your search form to match your needs.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Aug 2015 02:44:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-give-threshold-values-dynamically-in-the-search-query/m-p/190477#M54853</guid>
      <dc:creator>gcato</dc:creator>
      <dc:date>2015-08-24T02:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to give threshold  values dynamically in the search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-give-threshold-values-dynamically-in-the-search-query/m-p/190478#M54854</link>
      <description>&lt;P&gt;Add a &lt;CODE&gt;case&lt;/CODE&gt; statement like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eval thresholdValue=case(tier="tier1", 70, tier="tier2", 80 , tier="tier3", 90, true(), 0) | ...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So it would be like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;source="C:Network Analysistier1rusxwalmartedc S0-0-0.csv" OR source="C:Network Analysistier1rdinmumbai010-7-1 S2-0.csv" OR source="C:Network Analysistier1rdgbreddit010-1-2 Gig0-2.csv" OR source="C:Network Analysistier2rdingurgao010-5-1 f0-1.csv" OR source="C:Network Analysistier3rdinsecund010-5-2 Gig0-0.csv" OR source="C:Network Analysistier2rdphcebu010-5-1 f0-2-0.csv"host="SEZ00VVM-153" sourcetype="csv" | rex field=source "(?&amp;lt;country&amp;gt;.*?)$"|lookup datacentre.csv country OUTPUT receivebandwidth sitename tier|search tier=tier1|eval Intraffic=IN/1048576 |eval Outtraffic=Out/1048576|eval result=(Intraffic)+(Outtraffic)|eval seventyperc= receivebandwidth*0.7 |eval eightyperc=receivebandwidth*0.8 |eval nightyperc=receivebandwidth*0.9 | eval thresholdValue=case(tier="tier1", 70, tier="tier2", 80 , tier="tier3", 90, true(), 0) | where result&amp;gt;thresholdValue |stats Values(result) AS Inout,values(seventyperc) AS 70%,Values(eightyperc) AS 80%,values(nightyperc) AS 90%,values(receivebandwidth) as 100% count as nc by sitename _time |bin _time span=1d|stats sum(nc) as NOC by sitename _time|eval NOH =NOC*5/60|timechart span=1d values(NOH) AS total by sitename
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Aug 2015 13:35:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-give-threshold-values-dynamically-in-the-search-query/m-p/190478#M54854</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-08-27T13:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to give threshold  values dynamically in the search query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-give-threshold-values-dynamically-in-the-search-query/m-p/190479#M54855</link>
      <description>&lt;P&gt;that worked thank u so much ...&lt;/P&gt;</description>
      <pubDate>Tue, 01 Sep 2015 06:37:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-give-threshold-values-dynamically-in-the-search-query/m-p/190479#M54855</guid>
      <dc:creator>deepthi5</dc:creator>
      <dc:date>2015-09-01T06:37:31Z</dc:date>
    </item>
  </channel>
</rss>

