<?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: timechart function not working as expected in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693186#M235880</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; thanks for the reply. I checked the events for the "&lt;SPAN&gt;Invalid"&lt;/SPAN&gt; matches (the default value in the case block&lt;SPAN&gt;) and I can see there is no "status" field being extracted for those events. So it's evident why those are marked as "Invalid". So the issue must be with the sourcetype, I guess.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sorry if I didn't mention that the data sets are not the same. I just want to show that the later screenshot has matches for count_httpunk and the first one doesn't have.&lt;/P&gt;</description>
    <pubDate>Fri, 12 Jul 2024 12:51:40 GMT</pubDate>
    <dc:creator>riyastk</dc:creator>
    <dc:date>2024-07-12T12:51:40Z</dc:date>
    <item>
      <title>timechart function not working as expected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693141#M235871</link>
      <description>&lt;P&gt;I have this query which is working well in Splunk8 whereas I am getting timechart with wrong values in Splunk9. Is there any chage in timchart or case function that may cause this query not to work perfectly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=my_index sourcetype=jetty_access_log host="apiserver--*" url="/serveapi*" | eval status_summary=case(status&amp;lt;200, "Invalid",status&amp;lt;300, "2xx", status&amp;lt;400, "3xx",status &amp;lt;500, "4xx",status&amp;lt;600, "5xx",True(),"Invalid") |  timechart span=5m count(eval(status_summary="2xx")) as count_http2xx, count(eval(status_summary="3xx")) as count_http3xx, count(eval(status_summary="4xx")) as count_http4xx, count(eval(status_summary="5xx")) as count_http5xx, count(eval(status_summary="Invalid")) as count_httpunk&lt;/LI-CODE&gt;
&lt;P&gt;This screenshot below shows the correct result (Splunk &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-07-12 at 11.28.31 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/31716iFD434DE9D907E19F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-07-12 at 11.28.31 AM.png" alt="Screenshot 2024-07-12 at 11.28.31 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This screenshot shows the incorrect result ( Splunk 9)&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-07-12 at 11.27.52 AM.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/31717iB2BDA40AE9EACB50/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screenshot 2024-07-12 at 11.27.52 AM.png" alt="Screenshot 2024-07-12 at 11.27.52 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 22:36:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693141#M235871</guid>
      <dc:creator>riyastk</dc:creator>
      <dc:date>2024-07-12T22:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: timechart function not working as expected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693142#M235872</link>
      <description>&lt;P&gt;Ciao&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/34488"&gt;@riyastk&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;I am not aware that there have been any changes in the functioning of the timechart function; are you really sure that the data in the first case are the same as in the second?&lt;BR /&gt;what happens if you launch the search before the timechart and count the occurrences by sight?&lt;/P&gt;&lt;P&gt;In particular, check the values ​​that are indicated in your search as "Invalid".&lt;BR /&gt;Then, since you use the eval command, why don't you use the results of this command instead of the "&amp;lt;2xx" condition?&lt;BR /&gt;otherwise this command is useless.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 06:31:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693142#M235872</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-07-12T06:31:08Z</dc:date>
    </item>
    <item>
      <title>Re: timechart function not working as expected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693186#M235880</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp; thanks for the reply. I checked the events for the "&lt;SPAN&gt;Invalid"&lt;/SPAN&gt; matches (the default value in the case block&lt;SPAN&gt;) and I can see there is no "status" field being extracted for those events. So it's evident why those are marked as "Invalid". So the issue must be with the sourcetype, I guess.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Sorry if I didn't mention that the data sets are not the same. I just want to show that the later screenshot has matches for count_httpunk and the first one doesn't have.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 12:51:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693186#M235880</guid>
      <dc:creator>riyastk</dc:creator>
      <dc:date>2024-07-12T12:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: timechart function not working as expected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693188#M235881</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/34488"&gt;@riyastk&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;let me know if I can help you more, or, please, accept one answer for the other people of Community.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 13:09:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693188#M235881</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-07-12T13:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: timechart function not working as expected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693189#M235882</link>
      <description>&lt;P&gt;What happens if you try this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|  timechart span=5m count by status_summary usenull=f useother=f&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Jul 2024 13:25:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693189#M235882</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-07-12T13:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: timechart function not working as expected</title>
      <link>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693205#M235886</link>
      <description>&lt;P&gt;You're running it on different sets of data, right? So how are we supposed to know what and why is the correct result?&lt;/P&gt;&lt;P&gt;Anyway, you're overthinking it. Replace the elaborate evals in your timechart with&lt;/P&gt;&lt;PRE&gt;| timechart span=5m&amp;nbsp; count by status_summary&lt;/PRE&gt;&lt;P&gt;Oh, and please post searches in either code block or preformatted style. Makes them much more readable.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jul 2024 17:53:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/timechart-function-not-working-as-expected/m-p/693205#M235886</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-07-12T17:53:50Z</dc:date>
    </item>
  </channel>
</rss>

