<?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: help on a stats command with a filter token in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/547335#M155190</link>
    <description>&lt;P&gt;Have you an example please?&lt;/P&gt;</description>
    <pubDate>Fri, 09 Apr 2021 10:02:00 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2021-04-09T10:02:00Z</dc:date>
    <item>
      <title>help on a stats command with a filter token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/545974#M154747</link>
      <description>&lt;P&gt;hello&lt;/P&gt;&lt;P&gt;I use the search below which works fine&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;`fiability` 
| fields host Logfile SourceName ProductName SITE DEPARTMENT RESPONSIBLE_USER
| search Logfile=Application AND (SourceName="Application Hang" OR SourceName="Application Error") 
| search (ProductName=*)  
| stats last(SITE) as SITE, last(DEPARTMENT) as DEPARTMENT, last(RESPONSIBLE_USER) as RESPONSIBLE_USER, count(eval(SourceName="Application Error")) as "Number of Errors", count(eval(SourceName="Application Hang")) as "Number of Hang", count as "Number of crashes" by ProductName 
| rename ProductName as Product 
| sort -"Number of crashes"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;The problem I have is in my xml file because I use token filters on DEPARTMENT and RESPONSIBLE_USER fields&lt;/P&gt;&lt;P&gt;Since I just use a stats by ProductName, the RESPONSIBLE_USER related to the ProductName is just the last RESPONSIBLE_USER of the productName and not all the RESPONSIBLE_USER for a specific ProductName&lt;/P&gt;&lt;P&gt;So when I use the token for the RESPONSIBLE_USER in my dashboard, it doesn't reflect the exact reality&lt;/P&gt;&lt;P&gt;And if I do a stats by ProductName RESPONSIBLE_USER it's not good because I have many count for a same ProductName&lt;/P&gt;&lt;P&gt;What I need is to have a single count for a same ProductName and in the same time having all the ProductName count for a same RESPONSIBLE_USER (it means something else than the last RESPONSIBLE_USER for a ProductName...)&lt;/P&gt;&lt;P&gt;Could you help me please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 09:27:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/545974#M154747</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2021-03-30T09:27:27Z</dc:date>
    </item>
    <item>
      <title>Re: help on a stats command with a filter token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/545999#M154758</link>
      <description>&lt;P&gt;Use the &lt;FONT face="courier new,courier"&gt;values&lt;/FONT&gt; function of &lt;FONT face="courier new,courier"&gt;stats&lt;/FONT&gt; to get all values of RESPONSIBLE_USER&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
| stats last(SITE) as SITE, last(DEPARTMENT) as DEPARTMENT, values(RESPONSIBLE_USER) as RESPONSIBLE_USER, count(eval(SourceName="Application Error")) as "Number of Errors", count(eval(SourceName="Application Hang")) as "Number of Hang", count as "Number of crashes" by ProductName 
...&lt;/LI-CODE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Mar 2021 12:17:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/545999#M154758</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-03-30T12:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: help on a stats command with a filter token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/546206#M154822</link>
      <description>&lt;P&gt;I have already done this and it works if I put the token before the stats command&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search ProductName="browser_*" AND RESPONSIBLE_USER=*ABCDE* 
| stats last(SITE) as SITE, values(DEPARTMENT) as DEPARTMENT, values(RESPONSIBLE_USER) as RESPONSIBLE_USER, count(eval(SourceName="Application Error")) as "Number of Errors", count(eval(SourceName="Application Hang")) as "Number of Hang", count as "Number of crashes" by ProductName &lt;/LI-CODE&gt;&lt;P&gt;but.....&lt;/P&gt;&lt;P&gt;For this search, I use a scheduled search&lt;/P&gt;&lt;P&gt;So it means that I use my filter token after the loadjob command&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| loadjob savedsearch="admin:XXXX:YYYYY" 
| search RESPONSIBLE_USER=$tok_filterresponsible|s$ &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;And in this case I am unable to filter on the good RESPONSIBLE_USER....&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 12:19:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/546206#M154822</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2021-03-31T12:19:44Z</dc:date>
    </item>
    <item>
      <title>Re: help on a stats command with a filter token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/546217#M154829</link>
      <description>&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;values&lt;/FONT&gt; function may produce a multi-value field that requires using the &lt;FONT face="courier new,courier"&gt;mvfind&lt;/FONT&gt; function to search.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Mar 2021 13:48:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/546217#M154829</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-03-31T13:48:40Z</dc:date>
    </item>
    <item>
      <title>Re: help on a stats command with a filter token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/547335#M155190</link>
      <description>&lt;P&gt;Have you an example please?&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 10:02:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/547335#M155190</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2021-04-09T10:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: help on a stats command with a filter token</title>
      <link>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/547410#M155234</link>
      <description>&lt;LI-CODE lang="markup"&gt;| loadjob savedsearch="admin:XXXX:YYYYY" 
| where isnotnull(mvfind(RESPONSIBLE_USER, $tok_filterresponsible|s$)))&lt;/LI-CODE&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;mvfind&lt;/FONT&gt; looks in the multi-value field for the given string.&amp;nbsp; If successful, it returns an index into the field; otherwise, it returns NULL.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Apr 2021 16:03:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/help-on-a-stats-command-with-a-filter-token/m-p/547410#M155234</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-04-09T16:03:02Z</dc:date>
    </item>
  </channel>
</rss>

