<?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 variables for which an event is missing in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533043#M150585</link>
    <description>&lt;P&gt;Hi all. A silly question. I have the below searchresult (in my application i'm printing logs for different processing status of a specific order: I would like to know if (and how) would it be possible to extract the number of orders for which i do have a "processStarted" log, and not an "orderSaved" one. And another query to extract the orderNumbers for these case.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;orderNumber&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;action&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;123&lt;/TD&gt;&lt;TD width="50%"&gt;processStarted&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;123&lt;/TD&gt;&lt;TD width="50%"&gt;orderSaved&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;125&lt;/TD&gt;&lt;TD width="50%"&gt;processStarted&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;125&lt;/TD&gt;&lt;TD width="50%"&gt;orderSaved&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;301&lt;/TD&gt;&lt;TD width="50%"&gt;processStarted&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;As per the above example, i would like&lt;BR /&gt;1) a query to extract the count (1 in this case, since only order 301 don't have an "orderSaved" entry)&lt;/P&gt;&lt;P&gt;2) a query to extract the orderNumbers for which i do have "processStarted", but not "orderSaved"). Only 301 in this case&lt;/P&gt;&lt;P&gt;Which operation you would suggest me to investigate? Can you point me to some examples?&lt;/P&gt;</description>
    <pubDate>Mon, 14 Dec 2020 17:57:19 GMT</pubDate>
    <dc:creator>GioCortez</dc:creator>
    <dc:date>2020-12-14T17:57:19Z</dc:date>
    <item>
      <title>Count variables for which an event is missing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533043#M150585</link>
      <description>&lt;P&gt;Hi all. A silly question. I have the below searchresult (in my application i'm printing logs for different processing status of a specific order: I would like to know if (and how) would it be possible to extract the number of orders for which i do have a "processStarted" log, and not an "orderSaved" one. And another query to extract the orderNumbers for these case.&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;orderNumber&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%"&gt;&lt;STRONG&gt;action&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;123&lt;/TD&gt;&lt;TD width="50%"&gt;processStarted&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;123&lt;/TD&gt;&lt;TD width="50%"&gt;orderSaved&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;125&lt;/TD&gt;&lt;TD width="50%"&gt;processStarted&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;125&lt;/TD&gt;&lt;TD width="50%"&gt;orderSaved&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;301&lt;/TD&gt;&lt;TD width="50%"&gt;processStarted&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;As per the above example, i would like&lt;BR /&gt;1) a query to extract the count (1 in this case, since only order 301 don't have an "orderSaved" entry)&lt;/P&gt;&lt;P&gt;2) a query to extract the orderNumbers for which i do have "processStarted", but not "orderSaved"). Only 301 in this case&lt;/P&gt;&lt;P&gt;Which operation you would suggest me to investigate? Can you point me to some examples?&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 17:57:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533043#M150585</guid>
      <dc:creator>GioCortez</dc:creator>
      <dc:date>2020-12-14T17:57:19Z</dc:date>
    </item>
    <item>
      <title>Re: Count variables for which an event is missing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533051#M150588</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229717"&gt;@GioCortez&lt;/a&gt;&amp;nbsp;, please try below query;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats count by orderNumber
| where count=1
| addcoltotals &lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 14 Dec 2020 18:49:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533051#M150588</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2020-12-14T18:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Count variables for which an event is missing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533298#M150678</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp;for the quick response! That did the trick. Now i would like to complex things a little bit...basically i have orders flowing from one system to another. I have logs for which an order is sent ("processStarted") and for which an order is saved in the target system ("orderSaved"). But the problem with this, is that, basing on the search time restriction the user is setting, i may loose "orderSaved" events which happened after the timeframe. Is there any feasible (and acceptable, in terms of performances) solution for this?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 09:05:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533298#M150678</guid>
      <dc:creator>GioCortez</dc:creator>
      <dc:date>2020-12-16T09:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: Count variables for which an event is missing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533302#M150681</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229717"&gt;@GioCortez&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;Maybe you can give some time for "orderSaved" event before creating an alert. I think there will be acceptable timeframe after "processStarted" event. Let's say orders should be saved in hour, you can use below query as 5m scheduled. It will wait for on hour to show unprocessed order.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats count max(_time) as _time by orderNumber
| eval wait_time=now()-_time
| search count=1 wait_time&amp;gt;3600 
| addcoltotals  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 09:37:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533302#M150681</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2020-12-16T09:37:25Z</dc:date>
    </item>
    <item>
      <title>Re: Count variables for which an event is missing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533336#M150694</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;,&amp;nbsp;that made my day! One more thing: what if instead of using now() i want to use the "latest" date selected in the range picker? Is there a variable where starttime and endtime is stored? So that i could do something like the below?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats count max(_time) as _time by orderNumber
| eval wait_time=rangepickerenddate()-_time
| search count=1 wait_time&amp;gt;3600 
| addcoltotals  &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 14:11:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533336#M150694</guid>
      <dc:creator>GioCortez</dc:creator>
      <dc:date>2020-12-16T14:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Count variables for which an event is missing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533355#M150698</link>
      <description>&lt;P&gt;Great!&amp;nbsp;&lt;/P&gt;&lt;P&gt;"addinfo" command will help you. It will add these "info_min_time",&amp;nbsp;"info_max_time" fields.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats count max(_time) as _time by orderNumber
| addinfo
| eval wait_time=info_max_time-_time
| search count=1 wait_time&amp;gt;3600 
| addcoltotals &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Dec 2020 18:47:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533355#M150698</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2020-12-16T18:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Count variables for which an event is missing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533932#M150889</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206061"&gt;@scelikok&lt;/a&gt;&amp;nbsp; for helping out! That made the trick!&lt;/P&gt;</description>
      <pubDate>Wed, 23 Dec 2020 09:28:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Count-variables-for-which-an-event-is-missing/m-p/533932#M150889</guid>
      <dc:creator>GioCortez</dc:creator>
      <dc:date>2020-12-23T09:28:24Z</dc:date>
    </item>
  </channel>
</rss>

