<?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: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609321#M211885</link>
    <description>&lt;P&gt;stats dc(host) by site gives you the count of distinct hosts per site&lt;/P&gt;&lt;P&gt;stats count by host site gives a statistics event per unique site - effectively this is a distinct event for each host so by counting the statistics events from the first stats you get the same as the dc(host).&lt;/P&gt;</description>
    <pubDate>Fri, 12 Aug 2022 12:29:29 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-08-12T12:29:29Z</dc:date>
    <item>
      <title>How to create a query as below, but I would like to get the latest data for a field within span?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609275#M211864</link>
      <description>&lt;P&gt;Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within span of 1w.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;index=my_index | timechart span=1w estdc(host) by site&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to get the latest data for field "encrypted=false" within the span=1w for all host by site&lt;BR /&gt;&lt;BR /&gt;Edit: encrypted=false changed from true&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Edit 2:&lt;BR /&gt;Summary of What I am trying to get as clearly articulated by &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;"So my guess was right - this is what the search is basically doing&lt;/P&gt;
&lt;P&gt;For each week, it gets the latest encryption state for each host on each site&lt;/P&gt;
&lt;P&gt;Then keeps only those statistics where the state is false&lt;/P&gt;
&lt;P&gt;Then counts to events (one for each host with encryption false for that week) by week and site"&lt;/P&gt;
&lt;P&gt;Finally, it reorganises the data into chart format.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 15:19:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609275#M211864</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-12T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609285#M211869</link>
      <description>&lt;P&gt;Do you mean something like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index | where encrypted="true" | timechart span=1w estdc(host) by site&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Aug 2022 09:08:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609285#M211869</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-12T09:08:24Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609293#M211871</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I am searching for encrypted=false. So changing the below example to reflect that ( Sorry for the confusion in the Original post)&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I add.&amp;nbsp; &amp;nbsp; // where encrypted="false". //&amp;nbsp; &amp;nbsp; early in the query, search will only look for encrypted=false and not the&amp;nbsp; latest results for a given host, which could change within the span time frame(span=1w) and then I would get the count of the host which have encrypted= false, but that is not correct count. I mean I would get the results for all encrypted=false within the span but not the latest state within the time frame.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 09:38:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609293#M211871</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-12T09:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609295#M211872</link>
      <description>&lt;P&gt;I currently use this to get the data for list of host, this query only gives me the latest data of host.&lt;BR /&gt;&lt;BR /&gt;index=my_index | stats latest(encrypted) AS Encrypted BY host | where Encrypted="false"&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 09:42:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609295#M211872</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-12T09:42:52Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609297#M211873</link>
      <description>&lt;P&gt;Do you mean something like this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index 
| bin _time as week span=1w
| stats latest(encrypted) as encrypted by week host site&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Aug 2022 09:46:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609297#M211873</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-12T09:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609300#M211874</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am still looking for trend chart to show, thats why I am using timechart with the count of host per site per week&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 09:56:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609300#M211874</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-12T09:56:35Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609302#M211875</link>
      <description>&lt;P&gt;I am still not sure what it is you are trying to show, but here is my next guess&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=my_index 
| bin _time as week span=1w
| stats latest(encrypted) as encrypted by week host site
| where encrypted="false"
| stats count by week site
| xyseries week site count&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Aug 2022 10:04:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609302#M211875</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-12T10:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609303#M211876</link>
      <description>&lt;P&gt;index=my_index encrypted=false | timechart span=1w estdc(host) by site&lt;/P&gt;&lt;P&gt;How do I get the latest encrypted data which is false , removing encrypted=false from the main search.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 10:04:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609303#M211876</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-12T10:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609305#M211877</link>
      <description>&lt;P&gt;I am trying to get a trend chart per site per week, for all host which had encryption=false within a given week.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Basically trying to see the trend and check if we are improving week by week in encryption=false, basically needs to reduce.&lt;BR /&gt;&lt;BR /&gt;I am sorry If I was not clear before.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 10:06:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609305#M211877</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-12T10:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609306#M211878</link>
      <description>&lt;P&gt;So my guess was right - this is what the search is basically doing&lt;/P&gt;&lt;P&gt;For each week, it gets the latest encryption state for each host on each site&lt;/P&gt;&lt;P&gt;Then keeps only those statistics where the state is false&lt;/P&gt;&lt;P&gt;Then counts to events (one for each host with encryption false for that week) by week and site&lt;/P&gt;&lt;P&gt;Finally, it reorganises the data into chart format.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 10:16:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609306#M211878</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-12T10:16:28Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609307#M211879</link>
      <description>&lt;P&gt;Yes you are correct.&lt;BR /&gt;&lt;BR /&gt;I have one last question, how do I change the week to more readable format from current in the screenshot. I can do eval, but where do I add it in the query?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 10:22:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609307#M211879</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-12T10:22:57Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609309#M211880</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=my_index 
| bin _time as week span=1w
| stats latest(encrypted) as encrypted by week host site
| rename week as _time
| where encrypted="false"
| stats count by _time site
| xyseries _time site count&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Aug 2022 10:34:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609309#M211880</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-12T10:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609310#M211881</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;&lt;BR /&gt;Finally seeing data as required. I had few questions,&lt;BR /&gt;&lt;BR /&gt;I feel to do this, so that I only get single count per host, since I could have multiple entries in a week for the same host, if I use "count by _time"&lt;/P&gt;&lt;P&gt;| stats count by _time site&lt;/P&gt;&lt;P&gt;replace it with&amp;nbsp;&lt;/P&gt;&lt;P&gt;| stats dc(host) by site&lt;BR /&gt;&lt;BR /&gt;your thoughts&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 10:46:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609310#M211881</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-12T10:46:15Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609321#M211885</link>
      <description>&lt;P&gt;stats dc(host) by site gives you the count of distinct hosts per site&lt;/P&gt;&lt;P&gt;stats count by host site gives a statistics event per unique site - effectively this is a distinct event for each host so by counting the statistics events from the first stats you get the same as the dc(host).&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 12:29:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609321#M211885</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-08-12T12:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Latest data within a time span. I have a query as below, but I would like to get the latest data for a field within</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609332#M211890</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2022 14:35:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-create-a-query-as-below-but-I-would-like-to-get-the/m-p/609332#M211890</guid>
      <dc:creator>vgiri8</dc:creator>
      <dc:date>2022-08-12T14:35:36Z</dc:date>
    </item>
  </channel>
</rss>

