<?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: Inactive users vs active users in the last 30 days in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Inactive-users-vs-active-users-in-the-last-30-days/m-p/514664#M34388</link>
    <description>&lt;P&gt;This (ran over all-time) would get you a list of users and their status (Inactive/Active):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=prod 
| stats latest(_time) as last_seen by customerId
| eval status = if(last_seen &amp;gt; relative_time(now(), "-30d@d"),"Active","Inactive")&lt;/LI-CODE&gt;&lt;P&gt;I'm not entirely sure what the end result is that you are after, but hope this helps you in the right direction.&lt;/P&gt;</description>
    <pubDate>Tue, 18 Aug 2020 10:45:34 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2020-08-18T10:45:34Z</dc:date>
    <item>
      <title>Inactive users vs active users in the last 30 days</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Inactive-users-vs-active-users-in-the-last-30-days/m-p/514636#M34385</link>
      <description>&lt;P&gt;I want to build a Chart with two values. Inactive Users based on Customer ID and the Active Users who have used the service in the last 30 days.&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;index=prod  earliest=-30d AND latest=now
| eval Total = mvdedup(customerId)
| timechart span=1d dc(customerId) as "Active Users"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above code gives me the Chart for Active Users in the last 30 days. From All time data I want to get the count of Total Users and then derive the Inactive users. (Inactive = Total users - Active users). Please help me to rewrite the query to generate the required data.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 08:58:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Inactive-users-vs-active-users-in-the-last-30-days/m-p/514636#M34385</guid>
      <dc:creator>rajkskumar</dc:creator>
      <dc:date>2020-08-18T08:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Inactive users vs active users in the last 30 days</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Inactive-users-vs-active-users-in-the-last-30-days/m-p/514664#M34388</link>
      <description>&lt;P&gt;This (ran over all-time) would get you a list of users and their status (Inactive/Active):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=prod 
| stats latest(_time) as last_seen by customerId
| eval status = if(last_seen &amp;gt; relative_time(now(), "-30d@d"),"Active","Inactive")&lt;/LI-CODE&gt;&lt;P&gt;I'm not entirely sure what the end result is that you are after, but hope this helps you in the right direction.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Aug 2020 10:45:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Inactive-users-vs-active-users-in-the-last-30-days/m-p/514664#M34388</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2020-08-18T10:45:34Z</dc:date>
    </item>
    <item>
      <title>Re: Inactive users vs active users in the last 30 days</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Inactive-users-vs-active-users-in-the-last-30-days/m-p/514701#M34399</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/87518"&gt;@FrankVl&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Thank you very much for your support. This is working as expected. However, I need to add another condition to the "if" clause and I tried with the following. All the users are shown as "Inactive". Could you please point out the issue in the conditions?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=prod 
| stats latest(_time) as last_seen by customerId, processName
| eval status = if(processName=="Execution" AND (last_seen &amp;gt; relative_time(now(), "-30d@d")),"Active","Inactive")


index=prod 
| stats latest(_time) as last_seen by customerId
| eval status = if(match(processName,"Execution") AND (last_seen &amp;gt; relative_time(now(), "-30d@d")),"Active","Inactive")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Aug 2020 13:49:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Inactive-users-vs-active-users-in-the-last-30-days/m-p/514701#M34399</guid>
      <dc:creator>rajkskumar</dc:creator>
      <dc:date>2020-08-18T13:49:54Z</dc:date>
    </item>
    <item>
      <title>Re: Inactive users vs active users in the last 30 days</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Inactive-users-vs-active-users-in-the-last-30-days/m-p/514713#M34401</link>
      <description>&lt;P&gt;In the second query, the processName field doesn't exist after the stats command, so you can't use that in the condition.&lt;/P&gt;&lt;P&gt;I'm not sure why the first query doesn't work. Best to investigate it by removing the eval line and look at the results of the stats command, to see if the data would actually match the condition.&lt;/P&gt;&lt;P&gt;To make the 'last_seen' field human readable (for easier investigation if it is within the last 30d), you can do this (at the very bottom of your query, after doing any evals/conditions that need that field):&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| convert ctime(last_seen)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 18 Aug 2020 14:25:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Inactive-users-vs-active-users-in-the-last-30-days/m-p/514713#M34401</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2020-08-18T14:25:50Z</dc:date>
    </item>
  </channel>
</rss>

