<?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 to search days where fieldA was the same at the beginning and end of the day for each FieldB? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272966#M82211</link>
    <description>&lt;P&gt;Can you provide some of that awesome data you speak of?&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 26 May 2016 02:24:50 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-05-26T02:24:50Z</dc:date>
    <item>
      <title>How to search days where fieldA was the same at the beginning and end of the day for each FieldB?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272965#M82210</link>
      <description>&lt;P&gt;I'm going crazy trying to figure this out. Splunk is not my primary job function, so I am no good at time manipulation.&lt;/P&gt;

&lt;P&gt;I've been messing with eventstats and streamstats, but can't get it. I think streamstats is what I want.&lt;/P&gt;

&lt;P&gt;Here's my problem.&lt;/P&gt;

&lt;P&gt;I have thousands of units out in the field, each reporting multiple fields of data every hour (same fields per unit, just updated data every hour for health monitoring). For each unit reporting, I need to find days where a certain field was the same at the beginning of the day and at the end. Then I need to do this for every day over the past few weeks and sum the number of times each unit had this occurrence happen. I can't even get the search to work for one day, much less summarize them.&lt;/P&gt;

&lt;P&gt;I instantly return results for every unit, when I know that in my entire fleet of units I should only see a few.&lt;/P&gt;

&lt;P&gt;The fields of interest:&lt;BR /&gt;
serial number (SN)&lt;BR /&gt;
number of connections (conn)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex class=polling | bin _time span=1d | eventstats min(conn) as minCONN max(conn) as maxCONN by _time SN | eval deltaCONN=maxCONN-minCONN |where deltaCONN=0|table _time mi deltaCONN
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Can anyone help me with this? I am very stuck I think the hardest part for me is getting the time divisions right. Ideally I would only want to look at the field data from 9AM - 5PM each day - then I want to do this every day for every unit.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 01:00:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272965#M82210</guid>
      <dc:creator>mmcclelland86</dc:creator>
      <dc:date>2016-05-26T01:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to search days where fieldA was the same at the beginning and end of the day for each FieldB?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272966#M82211</link>
      <description>&lt;P&gt;Can you provide some of that awesome data you speak of?&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 02:24:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272966#M82211</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-05-26T02:24:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to search days where fieldA was the same at the beginning and end of the day for each FieldB?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272967#M82212</link>
      <description>&lt;P&gt;Try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=myindex class=polling | date_hourmin=strptime(_time, "%H%M") | search date_hourmin&amp;gt;=900 AND date_hourmin&amp;lt;1700 | bin _time span=1d | stats min(conn) AS minCONN max(conn) AS maxCONN BY _time SN | eval deltaCONN=maxCONN-minCONN |where deltaCONN=0|table _time deltaCONN SN
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then add on:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count AS daysNoChange BY SN
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 May 2016 02:29:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272967#M82212</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2016-05-26T02:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to search days where fieldA was the same at the beginning and end of the day for each FieldB?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272968#M82213</link>
      <description>&lt;P&gt;Trust me I would love to, but I can't share &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 14:56:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272968#M82213</guid>
      <dc:creator>mmcclelland86</dc:creator>
      <dc:date>2016-05-26T14:56:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to search days where fieldA was the same at the beginning and end of the day for each FieldB?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272969#M82214</link>
      <description>&lt;P&gt;The "date_hourmin" section errored for me as an invalid command, so I removed the pipe before and made it part of the search. This returns no results for me which is hard to believe. It seems I either get no results or all results haha. I appreciate your help. Perhaps I need to figure out my time division problem.&lt;/P&gt;

&lt;P&gt;our data is in epoch/UTC time, and I am in CST. One of my concerns is that when binning data by day, I am grabbing part of 2 different days, rather than a perfect midnight to midnight or 3AM-3AM. This would 100% ruin my chance of finding the few units I am actually after, as the symptom I am seeking is connections 1 day, no connections the next, then connections again on day 3. If I catch part of day 1 and 2, I will see a delta in connections, and even though none of them were in day 2, it would look like there were.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 15:01:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272969#M82214</guid>
      <dc:creator>mmcclelland86</dc:creator>
      <dc:date>2016-05-26T15:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to search days where fieldA was the same at the beginning and end of the day for each FieldB?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272970#M82215</link>
      <description>&lt;P&gt;its so easy to anonymize data...&lt;/P&gt;

&lt;P&gt;I just wrote a script to generate random arcsight events and it took about 15 minutes...&lt;/P&gt;

&lt;P&gt;You dont even need a script... just put random values in that make sense.&lt;/P&gt;</description>
      <pubDate>Thu, 26 May 2016 17:33:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-days-where-fieldA-was-the-same-at-the-beginning/m-p/272970#M82215</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-05-26T17:33:07Z</dc:date>
    </item>
  </channel>
</rss>

