<?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 count for multiple fields with values after initial count with where clause in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569771#M10241</link>
    <description>&lt;P&gt;I'm attempting to get a count for multiple fields Description and ActionDescription with the values for them AFTER counting by another field with a where clause over a period of time. This is what I'm wanting:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE width="662"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="70"&gt;UserName&lt;/TD&gt;&lt;TD width="74"&gt;Description&lt;/TD&gt;&lt;TD width="110"&gt;DescriptionCount&lt;/TD&gt;&lt;TD width="112"&gt;ActionDescription&lt;/TD&gt;&lt;TD width="148"&gt;ActionDescriptionCount&lt;/TD&gt;&lt;TD width="42"&gt;Count&lt;/TD&gt;&lt;TD width="106"&gt;_time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Andy&lt;/TD&gt;&lt;TD width="74"&gt;SSO&lt;BR /&gt;Send to home&lt;BR /&gt;update password&lt;/TD&gt;&lt;TD width="110"&gt;1&lt;BR /&gt;1&lt;BR /&gt;1&lt;BR /&gt;1&lt;/TD&gt;&lt;TD width="112"&gt;Sign in&lt;BR /&gt;Sign in successful&lt;/TD&gt;&lt;TD width="148"&gt;1&lt;BR /&gt;1&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;10/5/2021 15:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bob&lt;/TD&gt;&lt;TD width="74"&gt;Authentication Successful&lt;BR /&gt;Sending to SecondFactor&lt;BR /&gt;Sent token via SMS&lt;BR /&gt;Successfully Authorized&lt;/TD&gt;&lt;TD width="110"&gt;1&lt;BR /&gt;2&lt;BR /&gt;1&lt;BR /&gt;3&lt;BR /&gt;1&lt;/TD&gt;&lt;TD width="112"&gt;Sign in&lt;BR /&gt;Sign in successful&lt;BR /&gt;Sign in failed&lt;/TD&gt;&lt;TD width="148"&gt;1&lt;BR /&gt;1&lt;BR /&gt;2&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;10/5/2021 17:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the closest I've got but there are times where either the DescriptionCount or ActionDescriptionCount has missed a count for the Description or the ActionDescription:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;index=foo source=bar&lt;BR /&gt;| bin _time span=1h&lt;BR /&gt;| fillnull value="0"&lt;BR /&gt;| eventstats count by UserName _time&lt;BR /&gt;| where count &amp;gt; 500&lt;BR /&gt;| rename count as UserNameCount&lt;BR /&gt;| eventstats count by Description&lt;BR /&gt;| rename count as DescriptionCount&lt;BR /&gt;| eventstats count by ActionDescription&lt;BR /&gt;| rename count as ActionDescriptionCount&lt;BR /&gt;| stats values(ActionDescription) as ActionDescriptionValues values(ActionDescriptionCount) as ActionDescriptionCount values(Description) as Description values(DescriptionCount) as DescriptionCount values(_time) as "Time Frame(s)" count by UserName&lt;BR /&gt;| convert ctime("Time Frame(s)")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-10-05 153204.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16282iF5B543596C33155B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-10-05 153204.png" alt="Screenshot 2021-10-05 153204.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Oct 2021 19:32:26 GMT</pubDate>
    <dc:creator>wgawhh5hbnht</dc:creator>
    <dc:date>2021-10-05T19:32:26Z</dc:date>
    <item>
      <title>count for multiple fields with values after initial count with where clause</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569771#M10241</link>
      <description>&lt;P&gt;I'm attempting to get a count for multiple fields Description and ActionDescription with the values for them AFTER counting by another field with a where clause over a period of time. This is what I'm wanting:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE width="662"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="70"&gt;UserName&lt;/TD&gt;&lt;TD width="74"&gt;Description&lt;/TD&gt;&lt;TD width="110"&gt;DescriptionCount&lt;/TD&gt;&lt;TD width="112"&gt;ActionDescription&lt;/TD&gt;&lt;TD width="148"&gt;ActionDescriptionCount&lt;/TD&gt;&lt;TD width="42"&gt;Count&lt;/TD&gt;&lt;TD width="106"&gt;_time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Andy&lt;/TD&gt;&lt;TD width="74"&gt;SSO&lt;BR /&gt;Send to home&lt;BR /&gt;update password&lt;/TD&gt;&lt;TD width="110"&gt;1&lt;BR /&gt;1&lt;BR /&gt;1&lt;BR /&gt;1&lt;/TD&gt;&lt;TD width="112"&gt;Sign in&lt;BR /&gt;Sign in successful&lt;/TD&gt;&lt;TD width="148"&gt;1&lt;BR /&gt;1&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;10/5/2021 15:00&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Bob&lt;/TD&gt;&lt;TD width="74"&gt;Authentication Successful&lt;BR /&gt;Sending to SecondFactor&lt;BR /&gt;Sent token via SMS&lt;BR /&gt;Successfully Authorized&lt;/TD&gt;&lt;TD width="110"&gt;1&lt;BR /&gt;2&lt;BR /&gt;1&lt;BR /&gt;3&lt;BR /&gt;1&lt;/TD&gt;&lt;TD width="112"&gt;Sign in&lt;BR /&gt;Sign in successful&lt;BR /&gt;Sign in failed&lt;/TD&gt;&lt;TD width="148"&gt;1&lt;BR /&gt;1&lt;BR /&gt;2&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;TD&gt;10/5/2021 17:00&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the closest I've got but there are times where either the DescriptionCount or ActionDescriptionCount has missed a count for the Description or the ActionDescription:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;index=foo source=bar&lt;BR /&gt;| bin _time span=1h&lt;BR /&gt;| fillnull value="0"&lt;BR /&gt;| eventstats count by UserName _time&lt;BR /&gt;| where count &amp;gt; 500&lt;BR /&gt;| rename count as UserNameCount&lt;BR /&gt;| eventstats count by Description&lt;BR /&gt;| rename count as DescriptionCount&lt;BR /&gt;| eventstats count by ActionDescription&lt;BR /&gt;| rename count as ActionDescriptionCount&lt;BR /&gt;| stats values(ActionDescription) as ActionDescriptionValues values(ActionDescriptionCount) as ActionDescriptionCount values(Description) as Description values(DescriptionCount) as DescriptionCount values(_time) as "Time Frame(s)" count by UserName&lt;BR /&gt;| convert ctime("Time Frame(s)")&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2021-10-05 153204.png" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/16282iF5B543596C33155B/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2021-10-05 153204.png" alt="Screenshot 2021-10-05 153204.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Oct 2021 19:32:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569771#M10241</guid>
      <dc:creator>wgawhh5hbnht</dc:creator>
      <dc:date>2021-10-05T19:32:26Z</dc:date>
    </item>
    <item>
      <title>Re: count for multiple fields with values after initial count with where clause</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569783#M10242</link>
      <description>&lt;P&gt;To be honest, I am not completely clear what it is you are after, but does this get you any closer?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=foo source=bar
| bin _time span=1h
| fillnull value="0"
| eventstats count by UserName _time
| where count &amp;gt; 500
| rename count as UserNameCount
| eventstats count as DescriptionCount by Description UserName _time
| eventstats count as ActionDescriptionCount by ActionDescription UserName _time
| eval DescriptionCount = DescriptionCount."!".Description 
| eval ActionDescriptionCount = ActionDescriptionCount."!".ActionDescription
| stats values(DescriptionCount) as DescriptionCountValues values(ActionDescriptionCount) as ActionDescriptionCountValues values(UserNameCount) as UserNameCount by UserName _time
| eval DescriptionValues = DescriptionCountValues 
| eval DescriptionValues = mvmap(DescriptionValues,mvindex(split(DescriptionValues,"!"),1))
| eval DescriptionCountValues = mvmap(DescriptionCountValues,mvindex(split(DescriptionCountValues,"!"),0))
| eval ActionDescriptionValues = ActionDescriptionCountValues 
| eval ActionDescriptionValues = mvmap(ActionDescriptionValues,mvindex(split(ActionDescriptionValues,"!"),1))
| eval ActionDescriptionCountValues = mvmap(ActionDescriptionCountValues,mvindex(split(ActionDescriptionCountValues,"!"),0))&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 05 Oct 2021 20:14:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569783#M10242</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-05T20:14:14Z</dc:date>
    </item>
    <item>
      <title>Re: count for multiple fields with values after initial count with where clause</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569877#M10250</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;! This is exactly what I was attempting to do!&lt;BR /&gt;What does the "!" do in this eval commands?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval DescriptionCount = DescriptionCount."!".Description &lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;The docs only show it being used for !=, nothing else is coming up when I search, and when I run it by itself then I get the count before the Description with a ! between, e.g.:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;4!Success&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;amp; then later it appears as though you're removing the ! with the mvindex? I'm very confused on how you got this to work&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 13:01:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569877#M10250</guid>
      <dc:creator>wgawhh5hbnht</dc:creator>
      <dc:date>2021-10-06T13:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: count for multiple fields with values after initial count with where clause</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569881#M10253</link>
      <description>&lt;P&gt;The issue you had with your search and what you were apparently trying to do was associate the counts with the descriptions. By creating a string with the count followed by the description separated by a character that didn't appear to be present in either, I chose "!" for this but "#" or "%" might have worked equally well, this created a field value with both in. This field could then be gathered by the stats command grouped by UserName and _time. Then, you just needed to split the two values apart into count and description. Because these fields were gathered into multivalue fields by the stats values aggregators, we had to use the mvmap function to manipulate the elements in the mv fields.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 13:21:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569881#M10253</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-06T13:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: count for multiple fields with values after initial count with where clause</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569917#M10257</link>
      <description>&lt;P&gt;Thank you for the explanation, that makes sense! Much appreciated!!!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 15:43:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/count-for-multiple-fields-with-values-after-initial-count-with/m-p/569917#M10257</guid>
      <dc:creator>wgawhh5hbnht</dc:creator>
      <dc:date>2021-10-06T15:43:54Z</dc:date>
    </item>
  </channel>
</rss>

