<?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 Counting sessions with missing events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Counting-sessions-with-missing-events/m-p/549134#M155781</link>
    <description>&lt;P&gt;Hey gang - searching for missing data is probably the weakest part of my Splunk skillset.&amp;nbsp; I just have a hard time thinking through how to even write such a query.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a transaction that usually goes event_name=A, event_name=B, event_name=C.&amp;nbsp; But I'm trying to research a situation where B is missing sometimes.&amp;nbsp; I'd like to be able to build a timechart that shows the number of transactions in which B is &lt;EM&gt;missing&lt;/EM&gt;.&amp;nbsp; &amp;nbsp;The events in transaction are all linked by a common identifier that we'll call session_id.&lt;/P&gt;&lt;P&gt;I've looked at the&amp;nbsp;&lt;STRONG&gt;transaction&lt;/STRONG&gt; command and I suppose I understand that.&lt;/P&gt;&lt;P&gt;index=indexname event_name=A OR event_name=B OR event_name=C | transaction session_id startsWith=A endsWith=C maxspan=10m&lt;/P&gt;&lt;P&gt;But I don't know where to go from here.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Apr 2021 14:54:54 GMT</pubDate>
    <dc:creator>ShagVT</dc:creator>
    <dc:date>2021-04-23T14:54:54Z</dc:date>
    <item>
      <title>Counting sessions with missing events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-sessions-with-missing-events/m-p/549134#M155781</link>
      <description>&lt;P&gt;Hey gang - searching for missing data is probably the weakest part of my Splunk skillset.&amp;nbsp; I just have a hard time thinking through how to even write such a query.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a transaction that usually goes event_name=A, event_name=B, event_name=C.&amp;nbsp; But I'm trying to research a situation where B is missing sometimes.&amp;nbsp; I'd like to be able to build a timechart that shows the number of transactions in which B is &lt;EM&gt;missing&lt;/EM&gt;.&amp;nbsp; &amp;nbsp;The events in transaction are all linked by a common identifier that we'll call session_id.&lt;/P&gt;&lt;P&gt;I've looked at the&amp;nbsp;&lt;STRONG&gt;transaction&lt;/STRONG&gt; command and I suppose I understand that.&lt;/P&gt;&lt;P&gt;index=indexname event_name=A OR event_name=B OR event_name=C | transaction session_id startsWith=A endsWith=C maxspan=10m&lt;/P&gt;&lt;P&gt;But I don't know where to go from here.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 14:54:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-sessions-with-missing-events/m-p/549134#M155781</guid>
      <dc:creator>ShagVT</dc:creator>
      <dc:date>2021-04-23T14:54:54Z</dc:date>
    </item>
    <item>
      <title>Re: Counting sessions with missing events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-sessions-with-missing-events/m-p/549136#M155782</link>
      <description>&lt;P&gt;Assuming that session_id is unique across transactions, this will tell you when a transaction with fewer than 3 unique events started and finished&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indexname event_name=A OR event_name=B OR event_name=C
| stats dc(event_name) as events earliest(_time) as start latest(_time) as end by session_id
| where events &amp;lt; 3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;If you specifically want the check event B, you could&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indexname event_name=A OR event_name=B OR event_name=C
| stats values(event_name) as events earliest(_time) as start latest(_time) as end by session_id
| where isnull(mvfind(events,"B"))&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 23 Apr 2021 15:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-sessions-with-missing-events/m-p/549136#M155782</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-23T15:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: Counting sessions with missing events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Counting-sessions-with-missing-events/m-p/549154#M155788</link>
      <description>&lt;P&gt;Your second query here is basically what I was looking for.&amp;nbsp; To make it work as a timechart I ended up doing this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=indexname event_name=A OR event_name=B OR event_name=C
| stats values(event_name) as events earliest(_time) as start latest(_time) as end by session_id
| where isnull(mvfind(events,"B"))
| eval _time=start
| timechart count&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;THANK YOU!!!&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Apr 2021 16:43:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Counting-sessions-with-missing-events/m-p/549154#M155788</guid>
      <dc:creator>ShagVT</dc:creator>
      <dc:date>2021-04-23T16:43:45Z</dc:date>
    </item>
  </channel>
</rss>

