<?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 max values from two weeks using  timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/max-values-from-two-weeks-using-timechart/m-p/742085#M240762</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;i have a dataset where I'm generating a column of number of servers per day.&amp;nbsp; using a timechart command for last 2 weeks.&lt;BR /&gt;earliest="-14d" latest=now() index=*......&amp;nbsp;&lt;SPAN&gt;| timechart span=1d dc(hostname) as servercount&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My requirement is to split the data in previous week and latest week and get the maximum count from the previous week and the latest week&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Mar 2025 10:57:25 GMT</pubDate>
    <dc:creator>secure</dc:creator>
    <dc:date>2025-03-18T10:57:25Z</dc:date>
    <item>
      <title>max values from two weeks using  timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/max-values-from-two-weeks-using-timechart/m-p/742085#M240762</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;i have a dataset where I'm generating a column of number of servers per day.&amp;nbsp; using a timechart command for last 2 weeks.&lt;BR /&gt;earliest="-14d" latest=now() index=*......&amp;nbsp;&lt;SPAN&gt;| timechart span=1d dc(hostname) as servercount&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;My requirement is to split the data in previous week and latest week and get the maximum count from the previous week and the latest week&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 10:57:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/max-values-from-two-weeks-using-timechart/m-p/742085#M240762</guid>
      <dc:creator>secure</dc:creator>
      <dc:date>2025-03-18T10:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: max values from two weeks using  timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/max-values-from-two-weeks-using-timechart/m-p/742086#M240763</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/274955"&gt;@secure&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;did yu tried to use a different span period?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;earliest="-14d" latest=now() index=*...... 
| timechart span=1w dc(hostname) AS servercount&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 18 Mar 2025 11:06:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/max-values-from-two-weeks-using-timechart/m-p/742086#M240763</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2025-03-18T11:06:15Z</dc:date>
    </item>
    <item>
      <title>Re: max values from two weeks using  timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/max-values-from-two-weeks-using-timechart/m-p/742088#M240764</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;That's something different. You're calculating &lt;EM&gt;weekly&lt;/EM&gt; count of distict values whereas, as I understand, &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/274955"&gt;@secure&lt;/a&gt; wants to have maximum value of &lt;EM&gt;daily&lt;/EM&gt; distinct count per week.&lt;/P&gt;&lt;P&gt;There are several possible approaches here.&lt;/P&gt;&lt;P&gt;One is to use the timechart output and use timewrap to transform the output into separate weekly data series. Since timewrap is a relatively straightforward command I'll leave the actual search to the reader &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Another way is to do manual binning&lt;/P&gt;&lt;PRE&gt;&amp;lt;@secure's search&amp;gt;&lt;BR /&gt;| bin _time span=1w as weekno&lt;BR /&gt;| stats max(servercount) by weekno&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Mar 2025 11:25:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/max-values-from-two-weeks-using-timechart/m-p/742088#M240764</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2025-03-18T11:25:23Z</dc:date>
    </item>
  </channel>
</rss>

