<?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: SplunkJS Search Manager collect twice same event! in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/SplunkJS-Search-Manager-collects-the-same-event-twice/m-p/385228#M6427</link>
    <description>&lt;P&gt;Hi @hellosplunkit,&lt;/P&gt;

&lt;P&gt;Check out your &lt;CODE&gt;console.log&lt;/CODE&gt;commands, you have :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;console.log(searchResult);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;console.log("Data (rows): ", searchResult.data().rows);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That could be what's causing the duplication. Easiest solution would be to get rid of all the console.log and start adding them one by one to see where you get the issue. Once that is identified it should be easy to deduplicate the results.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2019 06:07:25 GMT</pubDate>
    <dc:creator>DavidHourani</dc:creator>
    <dc:date>2019-05-23T06:07:25Z</dc:date>
    <item>
      <title>SplunkJS Search Manager collects the same event twice.</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/SplunkJS-Search-Manager-collects-the-same-event-twice/m-p/385227#M6426</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;BR /&gt;
I'm on Splunk Enterprise 7.2.6.&lt;BR /&gt;
i launch a javascript SearchManager to show some data on console.&lt;BR /&gt;
Unfortunately it shows the data twice.i don't know why. i had saw the others answer &lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/659188/splunkjs-search-manager-collect-twice-same-event.html" target="_blank"&gt;https://answers.splunk.com/answers/659188/splunkjs-search-manager-collect-twice-same-event.html&lt;/A&gt; &lt;BR /&gt;
but it didn't work. help me ,thank you very much.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;setInterval(function () {&lt;BR /&gt;
            var searchManagerInstance = MVC.Components.get("searchManager3");&lt;BR /&gt;
            if (searchManagerInstance != undefined &amp;amp;&amp;amp; searchManagerInstance != null &amp;amp;&amp;amp; searchManagerInstance != "") {&lt;BR /&gt;
                searchManagerInstance.startSearch();&lt;BR /&gt;
                    var searchResult = searchManagerInstance.data("results");&lt;BR /&gt;
                console.log(searchResult);&lt;BR /&gt;
/*                searchResult.on("data", function() {&lt;BR /&gt;
                        console.log("Has data? ", searchResult.hasData());&lt;BR /&gt;
                        console.log("Data (rows): ", searchResult.data().rows);&lt;BR /&gt;
                        console.log("Backbone collection: (rows) ", searchResult.collection().raw.rows);&lt;BR /&gt;
                    });*/&lt;BR /&gt;
                searchResult.on("data", function () {&lt;BR /&gt;
                    console.log("hello world");&lt;BR /&gt;
                })&lt;BR /&gt;
            }else{&lt;BR /&gt;
                var searchManager1 = new SearchManager(&lt;BR /&gt;
                    {&lt;BR /&gt;
                        id: "searchManager3",&lt;BR /&gt;
                        preview: "true",&lt;BR /&gt;
                        cache: "false",&lt;BR /&gt;
                        data : "results",&lt;BR /&gt;
                        search: "index=_internal (sourcetype=splunkd OR sourcetype=splunkd_access OR sourcetype=splunk_web_access OR sourcetype=splunkd_ui_access OR sourcetype=splunk_web_service) earliest=-5m@m latest=@m |stats count by sourcetype"&lt;BR /&gt;
                    }&lt;BR /&gt;
                );&lt;BR /&gt;
            }&lt;BR /&gt;
        },2000);&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Sep 2020 00:39:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/SplunkJS-Search-Manager-collects-the-same-event-twice/m-p/385227#M6426</guid>
      <dc:creator>hellosplunkit</dc:creator>
      <dc:date>2020-09-30T00:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: SplunkJS Search Manager collect twice same event!</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/SplunkJS-Search-Manager-collects-the-same-event-twice/m-p/385228#M6427</link>
      <description>&lt;P&gt;Hi @hellosplunkit,&lt;/P&gt;

&lt;P&gt;Check out your &lt;CODE&gt;console.log&lt;/CODE&gt;commands, you have :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;console.log(searchResult);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;console.log("Data (rows): ", searchResult.data().rows);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That could be what's causing the duplication. Easiest solution would be to get rid of all the console.log and start adding them one by one to see where you get the issue. Once that is identified it should be easy to deduplicate the results.&lt;/P&gt;

&lt;P&gt;Cheers,&lt;BR /&gt;
David&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 06:07:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/SplunkJS-Search-Manager-collects-the-same-event-twice/m-p/385228#M6427</guid>
      <dc:creator>DavidHourani</dc:creator>
      <dc:date>2019-05-23T06:07:25Z</dc:date>
    </item>
  </channel>
</rss>

