<?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 Measure Memory Available_Bytes using sai_metrics_indexes but within a time range in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Measure-Memory-Available-Bytes-using-sai-metrics-indexes-but/m-p/514027#M144276</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Trying to know, if it is possible to measure Memory Available using the sai_metrics_indexes. More details of the requirement is below:&lt;/P&gt;&lt;P&gt;I have a process which starts and then runs for quite some time. I am able to get the start time and end time of that process run using the below query:&lt;/P&gt;&lt;P&gt;index=test sourcetype="test:node" "processStart()" OR "processEnd()" | stats earliest(_time) AS Earliest, latest(_time) AS Latest | eval diff=Latest-Earliest | eval FirstEvent=strftime(Earliest,"%m/%d/%y %H:%M:%S") | eval LastEvent=strftime(Latest,"%m/%d/%y %H:%M:%S") | eval DiffEvent=strftime(diff,"%m/%d/%y %H:%M") | eval temp = tostring(diff,"duration") | eval NetTotalTime=replace(temp,"(\d*)\+*(\d+):(\d+):(\d+)","\1 days \2 hours \3 minutes \4 secs") | rename FirstEvent as ProcessStart, LastEvent as ProcessEnd&lt;BR /&gt;| table ProcessStart, ProcessEnd, NetTotalTime&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ProcessStart returned from the above query is:&amp;nbsp;08/11/20 06:01:46&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ProcessEnd returned from the above query is:&amp;nbsp;08/11/20 11:35:09&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Now using this&amp;nbsp;ProcessStart and ProcessEnd time, I want to find out my memory used, memory available during that time. In general I use the below query to find out the memory available:&lt;/P&gt;&lt;P&gt;| mstats avg(_value) prestats=true WHERE metric_name="Memory.Available_Bytes" AND "index"="em_metrics" AND "host"="abc" AND `sai_metrics_indexes` span=10s&lt;BR /&gt;| timechart avg(_value) AS Avg span=10s&lt;BR /&gt;| fields - _span*&lt;/P&gt;&lt;P&gt;Problem with the above query is that, it gives me the data according to the time range I specify in the time picker. Instead I want to search this query within my&amp;nbsp;ProcessStart&amp;nbsp; and&amp;nbsp;ProcessEnd.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Also, is it possible to use both the query in a single search so that I can generate a report from it.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope the question is clear. Looking forward to hear from someone soon&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Aug 2020 06:37:12 GMT</pubDate>
    <dc:creator>subhrangshu</dc:creator>
    <dc:date>2020-08-14T06:37:12Z</dc:date>
    <item>
      <title>Measure Memory Available_Bytes using sai_metrics_indexes but within a time range</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Measure-Memory-Available-Bytes-using-sai-metrics-indexes-but/m-p/514027#M144276</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Trying to know, if it is possible to measure Memory Available using the sai_metrics_indexes. More details of the requirement is below:&lt;/P&gt;&lt;P&gt;I have a process which starts and then runs for quite some time. I am able to get the start time and end time of that process run using the below query:&lt;/P&gt;&lt;P&gt;index=test sourcetype="test:node" "processStart()" OR "processEnd()" | stats earliest(_time) AS Earliest, latest(_time) AS Latest | eval diff=Latest-Earliest | eval FirstEvent=strftime(Earliest,"%m/%d/%y %H:%M:%S") | eval LastEvent=strftime(Latest,"%m/%d/%y %H:%M:%S") | eval DiffEvent=strftime(diff,"%m/%d/%y %H:%M") | eval temp = tostring(diff,"duration") | eval NetTotalTime=replace(temp,"(\d*)\+*(\d+):(\d+):(\d+)","\1 days \2 hours \3 minutes \4 secs") | rename FirstEvent as ProcessStart, LastEvent as ProcessEnd&lt;BR /&gt;| table ProcessStart, ProcessEnd, NetTotalTime&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ProcessStart returned from the above query is:&amp;nbsp;08/11/20 06:01:46&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ProcessEnd returned from the above query is:&amp;nbsp;08/11/20 11:35:09&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Now using this&amp;nbsp;ProcessStart and ProcessEnd time, I want to find out my memory used, memory available during that time. In general I use the below query to find out the memory available:&lt;/P&gt;&lt;P&gt;| mstats avg(_value) prestats=true WHERE metric_name="Memory.Available_Bytes" AND "index"="em_metrics" AND "host"="abc" AND `sai_metrics_indexes` span=10s&lt;BR /&gt;| timechart avg(_value) AS Avg span=10s&lt;BR /&gt;| fields - _span*&lt;/P&gt;&lt;P&gt;Problem with the above query is that, it gives me the data according to the time range I specify in the time picker. Instead I want to search this query within my&amp;nbsp;ProcessStart&amp;nbsp; and&amp;nbsp;ProcessEnd.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Also, is it possible to use both the query in a single search so that I can generate a report from it.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope the question is clear. Looking forward to hear from someone soon&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 06:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Measure-Memory-Available-Bytes-using-sai-metrics-indexes-but/m-p/514027#M144276</guid>
      <dc:creator>subhrangshu</dc:creator>
      <dc:date>2020-08-14T06:37:12Z</dc:date>
    </item>
  </channel>
</rss>

