<?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 do you calculate the percentage based upon the selection made in filter? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433279#M28552</link>
    <description>&lt;P&gt;@sbhatnagar88,&lt;/P&gt;

&lt;P&gt;If the compliance information is indexed using the actual time of the event, add the token to base search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=dbconnect sourcetype=dbconnect:sql:SCCM_AVCompliance_AllServers |where strftime(_time,"%B %Y")="$your_token_value$" 
|rest of your search"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 30 Jan 2019 13:39:25 GMT</pubDate>
    <dc:creator>renjith_nair</dc:creator>
    <dc:date>2019-01-30T13:39:25Z</dc:date>
    <item>
      <title>How do you calculate the percentage based upon the selection made in filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433278#M28551</link>
      <description>&lt;H2&gt;We have a dashboard panel which shows overall AV compliance % for windows servers.code is as below.&lt;/H2&gt;

&lt;PRE&gt;&lt;CODE&gt;index=dbconnect sourcetype=dbconnect:sql:SCCM_AVCompliance_AllServers 
| table Name DC OU ResourceID SignatureUpTo1DayOld AntivirusSignatureAge AntivirusSignatureUpdateDateTime AntivirusSignatureVersion 
| rename Name as host 
| join host 
    [| inputlookup elixpediadashboardservers.csv 
    | search (host="*") Environment="*" 
    | search "Operating System"=WINDOWS] 
| append 
    [| inputlookup elixpediadashboardservers.csv 
    | search (host="*") Environment="*" 
    | search "Operating System"=WINDOWS] 
| dedup host  
| fillnull AntivirusSignatureAge Value=2 
| eval Compliance=if(AntivirusSignatureAge==0 OR AntivirusSignatureAge==1 ,"COMPLIANT","NONCOMPLIANT") 
| stats count(eval(Compliance=="COMPLIANT")) as compliant, count(eval(Compliance=="NONCOMPLIANT")) as noncompliant, count as total 
| eval AVUpdateCompliance=round((compliant/total)*100,2) 
| table AVUpdateCompliance
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;HR /&gt;

&lt;P&gt;Now customer requirement is to add a filter on top of this panel, which shows last 4 months like&lt;BR /&gt;
January 2019&lt;BR /&gt;
December 2018&lt;BR /&gt;
November 2018&lt;BR /&gt;
October 2018&lt;/P&gt;

&lt;P&gt;and this filter has already been created.&lt;/P&gt;

&lt;P&gt;My query is...&lt;/P&gt;

&lt;P&gt;How do i pass a month as a token in my query so that, if a user selects November 2018 from dropdown, then the panel should show AV % compliance only for the month of November.&lt;/P&gt;

&lt;P&gt;Any help would be highly appreciable.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jan 2019 12:57:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433278#M28551</guid>
      <dc:creator>sbhatnagar88</dc:creator>
      <dc:date>2019-01-30T12:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate the percentage based upon the selection made in filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433279#M28552</link>
      <description>&lt;P&gt;@sbhatnagar88,&lt;/P&gt;

&lt;P&gt;If the compliance information is indexed using the actual time of the event, add the token to base search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=dbconnect sourcetype=dbconnect:sql:SCCM_AVCompliance_AllServers |where strftime(_time,"%B %Y")="$your_token_value$" 
|rest of your search"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Jan 2019 13:39:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433279#M28552</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-01-30T13:39:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate the percentage based upon the selection made in filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433280#M28553</link>
      <description>&lt;P&gt;Try with this: index=dbconnect sourcetype=dbconnect:sql:SCCM_AVCompliance_AllServers  [| makeresults |eval time=$token|s$ | eval time="01 ".time| eval time2= strptime(time, "%d %B %Y") | eval time3 = relative_time(time2, "+1mon")  | eval time3 = relative_time(time3, "-1d") | eval earliest=time2 | eval latest=time3 | return earliest, latest]&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:01:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433280#M28553</guid>
      <dc:creator>vishaltaneja070</dc:creator>
      <dc:date>2020-09-29T23:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate the percentage based upon the selection made in filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433281#M28554</link>
      <description>&lt;P&gt;That worked perfectly...Thank you much!!!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 06:07:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433281#M28554</guid>
      <dc:creator>sbhatnagar88</dc:creator>
      <dc:date>2019-02-01T06:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate the percentage based upon the selection made in filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433282#M28555</link>
      <description>&lt;P&gt;one more query..in case i want to pass latest month always in my token then how would i paas that?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 09:47:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433282#M28555</guid>
      <dc:creator>sbhatnagar88</dc:creator>
      <dc:date>2019-02-01T09:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate the percentage based upon the selection made in filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433283#M28556</link>
      <description>&lt;P&gt;if you are looking for current month try &lt;CODE&gt;strftime(now(),"%B %Y")&lt;/CODE&gt;&lt;BR /&gt;
If you are always using latest month, you dont need a token , instead you can use it directly to the search&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;where strftime(_time,"%B %Y")=strftime(now(),"%B %Y")&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:14:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433283#M28556</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2019-02-01T12:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do you calculate the percentage based upon the selection made in filter?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433284#M28557</link>
      <description>&lt;P&gt;hi Renjith,&lt;/P&gt;

&lt;P&gt;yes.Thanks.i got this one already but putting time filter on the index has made my searches/results very slow.Any idea about this?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2019 12:22:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-calculate-the-percentage-based-upon-the-selection/m-p/433284#M28557</guid>
      <dc:creator>sbhatnagar88</dc:creator>
      <dc:date>2019-02-01T12:22:00Z</dc:date>
    </item>
  </channel>
</rss>

