<?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 How to use mstats with post-processing in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-mstats-with-post-processing/m-p/450344#M78173</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm facing a strong issue with using a mstats command, working in a post-processing components on a dynamic webpage.&lt;/P&gt;

&lt;P&gt;Here is the thing, my basesearch is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var basesearch = new SearchManager({
            "id": "basesearch",
            "earliest_time": "$field9.earliest$",
            "latest_time": "$field9.latest$",
            "search": "|mstats",
            "status_buckets": 0,
            "sample_ratio": 1,
            "cancelOnUnload": true,
            "app": utils.getCurrentApp(),
            "auto_cancel": 90,
            cache: true,
            "runWhenTimeIsUndefined": false
        }, {tokens: true, tokenNamespace: "submitted"});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var search_metrics=" avg(_value) where metric_name=\"*."+rows[i][4].toString()+"\" span=5s by metric_name";
new PostProcessManager({
                                                        "search": mvc.tokenSafe(search_metrics),
                                                        "managerid": "basesearch",
                                                        "id": searchID
                                                }, {tokens: true, tokenNamespace: "submitted"});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see, I there is a dynamic variable rows[i][4] in the search, preventing me to put it in the basesearch. BUT, as Splunk adds automatically a pipe between the basesearch and the subsearch, it can't work. Do you have an idea on how to deal with it ? The basesearch can't be empty&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jul 2018 12:02:44 GMT</pubDate>
    <dc:creator>pokpok</dc:creator>
    <dc:date>2018-07-18T12:02:44Z</dc:date>
    <item>
      <title>How to use mstats with post-processing</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-use-mstats-with-post-processing/m-p/450344#M78173</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm facing a strong issue with using a mstats command, working in a post-processing components on a dynamic webpage.&lt;/P&gt;

&lt;P&gt;Here is the thing, my basesearch is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var basesearch = new SearchManager({
            "id": "basesearch",
            "earliest_time": "$field9.earliest$",
            "latest_time": "$field9.latest$",
            "search": "|mstats",
            "status_buckets": 0,
            "sample_ratio": 1,
            "cancelOnUnload": true,
            "app": utils.getCurrentApp(),
            "auto_cancel": 90,
            cache: true,
            "runWhenTimeIsUndefined": false
        }, {tokens: true, tokenNamespace: "submitted"});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var search_metrics=" avg(_value) where metric_name=\"*."+rows[i][4].toString()+"\" span=5s by metric_name";
new PostProcessManager({
                                                        "search": mvc.tokenSafe(search_metrics),
                                                        "managerid": "basesearch",
                                                        "id": searchID
                                                }, {tokens: true, tokenNamespace: "submitted"});
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As you can see, I there is a dynamic variable rows[i][4] in the search, preventing me to put it in the basesearch. BUT, as Splunk adds automatically a pipe between the basesearch and the subsearch, it can't work. Do you have an idea on how to deal with it ? The basesearch can't be empty&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 12:02:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-use-mstats-with-post-processing/m-p/450344#M78173</guid>
      <dc:creator>pokpok</dc:creator>
      <dc:date>2018-07-18T12:02:44Z</dc:date>
    </item>
  </channel>
</rss>

