<?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: How handle time-based join with streamstats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-handle-time-based-join-with-streamstats/m-p/175423#M50363</link>
    <description>&lt;P&gt;This should get you started:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=registration OR sourcetype=status | eventstats latest(state) AS finalState BY host | streamstats current=t last(state) AS currentState by host | stats count(eval(sourcetype=registration AND currentState="RUNNING")) by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 26 Jun 2015 16:31:34 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2015-06-26T16:31:34Z</dc:date>
    <item>
      <title>How handle time-based join with streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-handle-time-based-join-with-streamstats/m-p/175421#M50361</link>
      <description>&lt;P&gt;I have 2 sets of events, 1 for registration events, and 1 for host state events.  There is a common field between the 2 sets of events which is the host.  In the individual registration events, I need to know what the last known state for the host is so I can keep a running total of the number of registrations that have occurred.  For certain states, the count should get reset.&lt;/P&gt;

&lt;P&gt;For the last part, I know I'll need to create a field using eval to say what the increment/decrement value for the total is and then do a streamstats based upon the host name and state but correlating those values into the registration events has proven complicated.&lt;/P&gt;

&lt;P&gt;Any thoughts as to how to do this?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 19:46:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-handle-time-based-join-with-streamstats/m-p/175421#M50361</guid>
      <dc:creator>kwalking</dc:creator>
      <dc:date>2015-06-24T19:46:43Z</dc:date>
    </item>
    <item>
      <title>Re: How handle time-based join with streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-handle-time-based-join-with-streamstats/m-p/175422#M50362</link>
      <description>&lt;P&gt;Rather, not just should certain states reset the count, but the registrations should only be counted while the host is in the 'RUNNING' state.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2015 21:09:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-handle-time-based-join-with-streamstats/m-p/175422#M50362</guid>
      <dc:creator>kwalking</dc:creator>
      <dc:date>2015-06-24T21:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: How handle time-based join with streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-handle-time-based-join-with-streamstats/m-p/175423#M50363</link>
      <description>&lt;P&gt;This should get you started:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=registration OR sourcetype=status | eventstats latest(state) AS finalState BY host | streamstats current=t last(state) AS currentState by host | stats count(eval(sourcetype=registration AND currentState="RUNNING")) by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jun 2015 16:31:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-handle-time-based-join-with-streamstats/m-p/175423#M50363</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2015-06-26T16:31:34Z</dc:date>
    </item>
  </channel>
</rss>

