<?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 Timechart - _time subsearch issue in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61895#M15274</link>
    <description>&lt;P&gt;I need to feed several days most busy hour into a weighted score evolution over time, &lt;BR /&gt;
which I'm running troubles into..&lt;BR /&gt;
Let's say I the subsearch outputs something like the following into my main search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(date_month = february AND date_mday = 13 AND date_hour = 20) OR (date_month = february AND date_mday = 14 AND date_hour = 20)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to sum some values as components to the final expression, but considering I need the score evolution over time I've added &lt;STRONG&gt;by Platform date_month date_mday date_hour&lt;/STRONG&gt; so I don't lose the _time attributes.&lt;BR /&gt;&lt;BR /&gt;
My current expression,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(...)
| eval OptimumMem = case(
Platform=="SCPs" AND MemUsedPct &amp;lt;= 60, 1,
Platform=="DSCPs" AND MemUsedPct &amp;lt;= 75, 1,
(...)
Platform=="MGRs" AND MemUsedPct &amp;lt;= 60, 1
)
| eval AcceptableMem = case(
Platform=="SCPs" AND MemUsedPct &amp;gt; 60 AND MemUsedPct &amp;lt;= 75, 1,
Platform=="DSCPs" AND MemUsedPct &amp;gt; 75 AND MemUsedPct &amp;lt;= 90, 1,
(...)
Platform=="MGRs" AND MemUsedPct &amp;gt; 60 AND MemUsedPct &amp;lt;= 75, 1
)
| stats count(MemUsedPct) as TotalEvents sum(OptimumMem) as TotalOptimumMem sum(AcceptableMem) as TotalAcceptableMem by Platform date_month date_mday date_hour
    | fillnull 
| eval ScpMemApdex=if(Platform="SCPs",(TotalOptimumMem + TotalAcceptableMem/2) / TotalEvents,0)
| eval DscpMemApdex=if(Platform="DSCPs",(TotalOptimumMem + TotalAcceptableMem/2) / TotalEvents,0)
(...)
| eval MgrMemApdex=if(Platform="MGRs",(TotalOptimumMem + TotalAcceptableMem/2) / TotalEvents,0)
    | eval ApdexScore=round(100*(0.17*ScpMemApdex + 0.17*DscpMemApdex + 0.4*SdpMemApdex + 0.15*SmpMemApdex + 0.07*BitMemApdex + 0.04*MgrMemApdex), 2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is returning,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Platform    date_month  date_mday   date_hour   TotalEvents     TotalOptimumMem     TotalAcceptableMem  ApdexScore  DscpMemApdex    MgrMemApdex     ScpMemApdex
DSCPs   february    13  20  48  48  0   **17.00**   1   0   0       
MGRs    february    13  20  36  36  0   **4.00**    0   1   0   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How should I change it so I don't get    No results found when adding&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart sum(ApdexScore)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 13:31:09 GMT</pubDate>
    <dc:creator>splunk_zen</dc:creator>
    <dc:date>2020-09-28T13:31:09Z</dc:date>
    <item>
      <title>Timechart - _time subsearch issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61895#M15274</link>
      <description>&lt;P&gt;I need to feed several days most busy hour into a weighted score evolution over time, &lt;BR /&gt;
which I'm running troubles into..&lt;BR /&gt;
Let's say I the subsearch outputs something like the following into my main search.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(date_month = february AND date_mday = 13 AND date_hour = 20) OR (date_month = february AND date_mday = 14 AND date_hour = 20)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to sum some values as components to the final expression, but considering I need the score evolution over time I've added &lt;STRONG&gt;by Platform date_month date_mday date_hour&lt;/STRONG&gt; so I don't lose the _time attributes.&lt;BR /&gt;&lt;BR /&gt;
My current expression,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(...)
| eval OptimumMem = case(
Platform=="SCPs" AND MemUsedPct &amp;lt;= 60, 1,
Platform=="DSCPs" AND MemUsedPct &amp;lt;= 75, 1,
(...)
Platform=="MGRs" AND MemUsedPct &amp;lt;= 60, 1
)
| eval AcceptableMem = case(
Platform=="SCPs" AND MemUsedPct &amp;gt; 60 AND MemUsedPct &amp;lt;= 75, 1,
Platform=="DSCPs" AND MemUsedPct &amp;gt; 75 AND MemUsedPct &amp;lt;= 90, 1,
(...)
Platform=="MGRs" AND MemUsedPct &amp;gt; 60 AND MemUsedPct &amp;lt;= 75, 1
)
| stats count(MemUsedPct) as TotalEvents sum(OptimumMem) as TotalOptimumMem sum(AcceptableMem) as TotalAcceptableMem by Platform date_month date_mday date_hour
    | fillnull 
| eval ScpMemApdex=if(Platform="SCPs",(TotalOptimumMem + TotalAcceptableMem/2) / TotalEvents,0)
| eval DscpMemApdex=if(Platform="DSCPs",(TotalOptimumMem + TotalAcceptableMem/2) / TotalEvents,0)
(...)
| eval MgrMemApdex=if(Platform="MGRs",(TotalOptimumMem + TotalAcceptableMem/2) / TotalEvents,0)
    | eval ApdexScore=round(100*(0.17*ScpMemApdex + 0.17*DscpMemApdex + 0.4*SdpMemApdex + 0.15*SmpMemApdex + 0.07*BitMemApdex + 0.04*MgrMemApdex), 2)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;is returning,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Platform    date_month  date_mday   date_hour   TotalEvents     TotalOptimumMem     TotalAcceptableMem  ApdexScore  DscpMemApdex    MgrMemApdex     ScpMemApdex
DSCPs   february    13  20  48  48  0   **17.00**   1   0   0       
MGRs    february    13  20  36  36  0   **4.00**    0   1   0   
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How should I change it so I don't get    No results found when adding&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart sum(ApdexScore)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 13:31:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61895#M15274</guid>
      <dc:creator>splunk_zen</dc:creator>
      <dc:date>2020-09-28T13:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - _time subsearch issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61896#M15275</link>
      <description>&lt;P&gt;Are the ** on the ApdexScore part of the field value?&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2013 19:44:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61896#M15275</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2013-03-14T19:44:34Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - _time subsearch issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61897#M15276</link>
      <description>&lt;P&gt;You need to reconstruct _time. If there's no _time field, timechart will not work&lt;/P&gt;

&lt;P&gt;so do something like this before the timechart :&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | eval _time=&lt;/CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/CommonEvalFunctions"&gt;strptime&lt;/A&gt;&lt;CODE&gt;(date_hour." ".date_mday." ".date_month,&lt;/CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.2/SearchReference/Commontimeformatvariables"&gt;"%H %d %B"&lt;/A&gt;&lt;CODE&gt;)&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Then add :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart sum(ApdexScore)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You may actually want to include the year too ...&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2013 20:51:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61897#M15276</guid>
      <dc:creator>jonuwz</dc:creator>
      <dc:date>2013-03-14T20:51:03Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - _time subsearch issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61898#M15277</link>
      <description>&lt;P&gt;If you bin your original events into hours you could group by _time instead of those three, hence keeping the actual _time all the way through.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Mar 2013 21:17:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61898#M15277</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-14T21:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - _time subsearch issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61899#M15278</link>
      <description>&lt;P&gt;Flawless !&lt;BR /&gt;
Thank you jonuwz, really.&lt;BR /&gt;
I was getting trouble wrapping my head over what was the culprit.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 08:59:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61899#M15278</guid>
      <dc:creator>splunk_zen</dc:creator>
      <dc:date>2013-03-15T08:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - _time subsearch issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61900#M15279</link>
      <description>&lt;P&gt;Martin, I started using that approach, the issue with it is that forcing _time, would return the same value across all the main search timestamps, which would run me into trouble summing them in the timechart expression (whereas I need to compute a single daily value - representative of the busiest hour)&lt;/P&gt;

&lt;P&gt;_time   Platform    TotalEvents     TotalOptimumMem     TotalAcceptableMem  DscpMemApdex    ScpMemApdex&lt;BR /&gt;
13/02/2013 20:00:00.000 DSCPs   4   4   0   1   0&lt;BR /&gt;
13/02/2013 20:05:00.000 DSCPs   4   4   0   1   0&lt;BR /&gt;
13/02/2013 20:10:00.000 DSCPs   4   4   0   1   0&lt;BR /&gt;
13/02/2013 20:15:00.000 DSCPs   4   4   0   1   0&lt;BR /&gt;
13/02/2013 20:20:00.000 DSCPs   4   4   0   1   0&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 09:19:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61900#M15279</guid>
      <dc:creator>splunk_zen</dc:creator>
      <dc:date>2013-03-15T09:19:14Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - _time subsearch issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61901#M15280</link>
      <description>&lt;P&gt;Actually, no. Those ** were just to stand out.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 11:49:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61901#M15280</guid>
      <dc:creator>splunk_zen</dc:creator>
      <dc:date>2013-03-15T11:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - _time subsearch issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61902#M15281</link>
      <description>&lt;P&gt;I was thinking of binning by hour after you determine the day's value, right before the final stats.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Mar 2013 12:57:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61902#M15281</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-15T12:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - _time subsearch issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61903#M15282</link>
      <description>&lt;P&gt;Martin, how does the bin expression before stats look like?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:45:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61903#M15282</guid>
      <dc:creator>splunk_zen</dc:creator>
      <dc:date>2013-03-18T11:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart - _time subsearch issue</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61904#M15283</link>
      <description>&lt;P&gt;Something like bucket _time span=1h&lt;/P&gt;</description>
      <pubDate>Mon, 18 Mar 2013 11:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-time-subsearch-issue/m-p/61904#M15283</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-03-18T11:48:03Z</dc:date>
    </item>
  </channel>
</rss>

