<?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 Why are results different if my search is used in the dashboard versus the search bar? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359912#M23466</link>
    <description>&lt;P&gt;I have used sub earch, while running from search bar its showing correct result as single value. But when put it on Dashboard panel, its showing No result found. I tried to put that query in CDATA as well, but no luck.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="aa1" sourcetype="adlist" earliest=-8d latest=now
| table ComputerName
| dedup ComputerName
| eval ComputerName = lower(ComputerName)
| join type=inner ComputerName
[ search index="aa1" sourcetype="serverg" earliest=-8d latest=now
| rename Name as "ComputerName"
| eval ComputerName = lower(ComputerName)
| table ComputerName
]
| join type=inner ComputerName
[ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now
| rex field=_raw "Hostname=\"(?P[^.]+)" | rename Hostname as "ComputerName" | eval ComputerName = lower(ComputerName) | table ComputerName, Pattern | join type=left "Pattern" [ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now | table Pattern | dedup Pattern | sort-"Pattern" | streamstats count as row | eval Compliance = case(row=1, "Compliant(N, N-1, N-2)", row=2, "Compliant(N, N-1, N-2)", row=3 , "Compliant(N, N-1, N-2)", row&amp;gt;3 , "Non Compliant") | table "Pattern", Compliance] | table ComputerName, Pattern , Compliance] | table ComputerName, Pattern, Compliance | top limit=10 Compliance | search Compliance="Compliant(N, N-1, N-2)" | fields count 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Sep 2017 05:10:58 GMT</pubDate>
    <dc:creator>bawan</dc:creator>
    <dc:date>2017-09-27T05:10:58Z</dc:date>
    <item>
      <title>Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359912#M23466</link>
      <description>&lt;P&gt;I have used sub earch, while running from search bar its showing correct result as single value. But when put it on Dashboard panel, its showing No result found. I tried to put that query in CDATA as well, but no luck.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="aa1" sourcetype="adlist" earliest=-8d latest=now
| table ComputerName
| dedup ComputerName
| eval ComputerName = lower(ComputerName)
| join type=inner ComputerName
[ search index="aa1" sourcetype="serverg" earliest=-8d latest=now
| rename Name as "ComputerName"
| eval ComputerName = lower(ComputerName)
| table ComputerName
]
| join type=inner ComputerName
[ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now
| rex field=_raw "Hostname=\"(?P[^.]+)" | rename Hostname as "ComputerName" | eval ComputerName = lower(ComputerName) | table ComputerName, Pattern | join type=left "Pattern" [ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now | table Pattern | dedup Pattern | sort-"Pattern" | streamstats count as row | eval Compliance = case(row=1, "Compliant(N, N-1, N-2)", row=2, "Compliant(N, N-1, N-2)", row=3 , "Compliant(N, N-1, N-2)", row&amp;gt;3 , "Non Compliant") | table "Pattern", Compliance] | table ComputerName, Pattern , Compliance] | table ComputerName, Pattern, Compliance | top limit=10 Compliance | search Compliance="Compliant(N, N-1, N-2)" | fields count 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Sep 2017 05:10:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359912#M23466</guid>
      <dc:creator>bawan</dc:creator>
      <dc:date>2017-09-27T05:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359913#M23467</link>
      <description>&lt;P&gt;Version of SPLUNK Enterprise is 6.5.1&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 05:12:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359913#M23467</guid>
      <dc:creator>bawan</dc:creator>
      <dc:date>2017-09-27T05:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359914#M23468</link>
      <description>&lt;P&gt;Please ignore the above query .. below is the updated query :&lt;/P&gt;

&lt;P&gt;index="aa1" sourcetype="adlist" earliest=-8d latest=now &lt;BR /&gt;
| table ComputerName &lt;BR /&gt;
| dedup ComputerName &lt;BR /&gt;
| eval ComputerName = lower(ComputerName) &lt;BR /&gt;
| join type=inner ComputerName &lt;BR /&gt;
    [ search index="aa1" sourcetype="serverg" earliest=-8d latest=now &lt;BR /&gt;
    | rename Name as "ComputerName" &lt;BR /&gt;
    | eval ComputerName = lower(ComputerName) &lt;BR /&gt;
    | table ComputerName &lt;BR /&gt;
] &lt;BR /&gt;
| join type=inner ComputerName &lt;BR /&gt;
    [ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now &lt;BR /&gt;
    | rex field=_raw "Hostname=\"(?P&lt;HOSTNAME&gt;[^.]+)" &lt;BR /&gt;
    | rename Hostname as "ComputerName" &lt;BR /&gt;
    | eval ComputerName = lower(ComputerName) &lt;BR /&gt;
    | table ComputerName, Pattern &lt;BR /&gt;
    | join type=left "Pattern" &lt;BR /&gt;
        [ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now &lt;BR /&gt;
        | table Pattern &lt;BR /&gt;
        | dedup Pattern &lt;BR /&gt;
        | sort-"Pattern" &lt;BR /&gt;
        | streamstats count as row &lt;BR /&gt;
        | eval Compliance = case(row=1, "Compliant(N, N-1, N-2)", row=2, "Compliant(N, N-1, N-2)", row=3 , "Compliant(N, N-1, N-2)", row&amp;gt;3 , "Non Compliant") &lt;BR /&gt;
        | table "Pattern", Compliance] &lt;BR /&gt;
    | table ComputerName, Pattern , Compliance] &lt;BR /&gt;
| table ComputerName, Pattern, Compliance &lt;BR /&gt;
| top limit=10 Compliance &lt;BR /&gt;
| search Compliance="Compliant(N, N-1, N-2)" &lt;BR /&gt;
| fields count&lt;/HOSTNAME&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 05:44:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359914#M23468</guid>
      <dc:creator>bawan</dc:creator>
      <dc:date>2017-09-27T05:44:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359915#M23469</link>
      <description>&lt;P&gt;Hi bawan,&lt;BR /&gt;
I'm not sure to have understood your request, anyway, please review your search&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="aa1" sourcetype="adlist" earliest=-8d latest=now 
| eval ComputerName = lower(ComputerName) 
| dedup ComputerName 
| join type=inner ComputerName 
   [ search index="aa1" sourcetype="serverg" earliest=-8d latest=now 
   | rename Name as "ComputerName" 
   | eval ComputerName = lower(ComputerName) 
   | fields ComputerName 
   ] 
| join type=inner ComputerName 
   [ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now 
   | rex field=_raw "Hostname=\"(?P[^.]+)" 
   | rename Hostname as "ComputerName" 
   | eval ComputerName = lower(ComputerName) 
   | fields ComputerName, Pattern 
   | join type=left Pattern 
      [ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now 
      | table Pattern 
      | dedup Pattern 
      | sort -Pattern 
      | streamstats count as row 
      | eval Compliance = case(row=1, "Compliant(N, N-1, N-2)", row=2, "Compliant(N, N-1, N-2)", row=3 , "Compliant(N, N-1, N-2)", row&amp;gt;3 , "Non Compliant") 
      | fields Pattern  Compliance
      ]
   | fields ComputerName Pattern Compliance
   ]
| top Compliance 
| search Compliance="Compliant(N, N-1, N-2)" 
| table count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To debug your problem:&lt;BR /&gt;
at first run your subsearches and verify if results are more o less 50000 events because there's a limit to 50000 for subsearch results;&lt;BR /&gt;
after try to run each subsearch and check if you have the same result running the same searches putting 0 in sort commands (there a limit to 10000 results for sort command). &lt;/P&gt;

&lt;P&gt;At the end verify if you can semplify your search because join is not so performant!&lt;BR /&gt;
e.g. first part of your search could be transformed in &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="aa1" (sourcetype="adlist" OR sourcetype="serverg") earliest=-8d latest=now 
| rename Name as "ComputerName" 
| eval ComputerName = lower(ComputerName) 
| stats values(sourcetype) AS sourcetype BY ComputerName
| search sourcetype="adlist" sourcetype="serverg"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 10:07:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359915#M23469</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-09-27T10:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359916#M23470</link>
      <description>&lt;P&gt;Hi Giuseppe ,&lt;BR /&gt;
Thanks for the response, my query is working fine when I search from Search bar. Only problem is, its not showing values when I put it on Dashboard. Same Dashboard is working on Pre pod instance whose version is 6.6.1 and Prod splunk instance version is  6.5.1. Also, I am using same data source in background for both the instances.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 10:21:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359916#M23470</guid>
      <dc:creator>bawan</dc:creator>
      <dc:date>2017-09-27T10:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359917#M23471</link>
      <description>&lt;P&gt;Are you using search bar of the same app of dashboard?&lt;BR /&gt;
Have you, in you dashboard Post Process Searches?&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 10:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359917#M23471</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-09-27T10:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359918#M23472</link>
      <description>&lt;P&gt;On Dashboard panel where its showing No result found, i click on Open in search for that panel , it will open new search bar. On this, it show No results found, but when i hit enter key for search it will show result.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 11:25:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359918#M23472</guid>
      <dc:creator>bawan</dc:creator>
      <dc:date>2017-09-27T11:25:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359919#M23473</link>
      <description>&lt;P&gt;only two last stupid checks:&lt;BR /&gt;
try to add a new panel using the search that correctly runs and verify if it runs.&lt;/P&gt;

&lt;P&gt;After how did you copied this search?&lt;BR /&gt;
when you open your dashboard with dashboard editor, on the left side of each row of the search they should be some grey lines that mean tabs, check if there are in every row of your search, if not delete spaces on the left of each row: I found problems related to dirty chars in dashboards.&lt;/P&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 11:46:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359919#M23473</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-09-27T11:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359920#M23474</link>
      <description>&lt;P&gt;Did both the things, still facing same issue.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 12:09:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359920#M23474</guid>
      <dc:creator>bawan</dc:creator>
      <dc:date>2017-09-27T12:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359921#M23475</link>
      <description>&lt;P&gt;Sorry I haven't any other idea!&lt;BR /&gt;
Open a case to Splunk Support.&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 12:14:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359921#M23475</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2017-09-27T12:14:49Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359922#M23476</link>
      <description>&lt;P&gt;When converting to a dashboard, I almost always have to update the "escaping" to correct minor issues with what the system did for me automatically.&lt;/P&gt;

&lt;P&gt;However, it seems like this can be refactored to get your desired results more easily.&lt;/P&gt;

&lt;P&gt;From the inside out, you only want computers in index &lt;CODE&gt;bb1&lt;/CODE&gt; in the last two days with the three most recent patterns.  You are going to throw away all the &lt;CODE&gt;ComputerName&lt;/CODE&gt; records that don't have one of them anyway, so let's only pull those records in the first place.  That looks like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now 
       [ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now 
        | fields Pattern | dedup Pattern | sort - Pattern | streamstats count as row 
        | where row&amp;lt;=3 | table Pattern]
  | rex field=_raw "Hostname=\"(?&amp;lt;ComputerName&amp;gt;[^.]+)" 
  | eval ComputerName = lower(ComputerName)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, from the outside, you want all the &lt;CODE&gt;ComputerNames&lt;/CODE&gt; that have been in the &lt;CODE&gt;aa1&lt;/CODE&gt; index in the last 8 days, but only if they were in both sourcetypes &lt;CODE&gt;adlist&lt;/CODE&gt; and serverg.  That looks like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  index="aa1" sourcetype="adlist" OR sourcetype="serverg" earliest=-8d latest=now 
  | fields index sourcetype Name ComputerName
  | eval ComputerName=lower(coalesce(ComputerName, Name))
  | stats values(index) as index values(sourcetype) as sourcetype by ComputerName
  | where mvcount(sourcetype&amp;gt;1)
  | fields - sourcetype 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the final join should look like this...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="aa1" sourcetype="adlist" OR sourcetype="serverg" earliest=-8d latest=now 
| fields index sourcetype Name ComputerName
| eval ComputerName=lower(coalesce(ComputerName, Name))
| stats values(index) as index values(sourcetype) as sourcetype by ComputerName
| where mvcount(sourcetype&amp;gt;1)
| fields - sourcetype 
| join ComputerName
       [ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now 
             [ search index=bb1 source=DSM sourcetype=hostp earliest=-2d latest=now 
              | fields Pattern | dedup Pattern | sort - Pattern | streamstats count as row 
              | where row&amp;lt;=3 | table Pattern]
        | rex field=_raw "Hostname=\"(?&amp;lt;ComputerName&amp;gt;[^.]+)" 
        | eval ComputerName = lower(ComputerName)
        ] 
| stats count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This refactor should run a bit quicker than the original.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Sep 2017 18:51:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359922#M23476</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-09-27T18:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359923#M23477</link>
      <description>&lt;P&gt;Found the Problem:&lt;/P&gt;

&lt;P&gt;SubQuery join is not working on Dashboard , while same is working on Search Bar.&lt;/P&gt;

&lt;P&gt;For eg.&lt;/P&gt;

&lt;P&gt;[Query 1] join [ Query 2 join Query 3]  Not working on Dashboard .&lt;BR /&gt;
I changed it to &lt;BR /&gt;
[Query 1] join [ Query 2]  join [Query 3]&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2017 06:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/359923#M23477</guid>
      <dc:creator>bawan</dc:creator>
      <dc:date>2017-09-28T06:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/696969#M57136</link>
      <description>&lt;P&gt;I have the same issue&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 15:08:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/696969#M57136</guid>
      <dc:creator>cyassa</dc:creator>
      <dc:date>2024-08-21T15:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Why are results different if my search is used in the dashboard versus the search bar?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/696970#M57137</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/54706"&gt;@bawan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;let us know if we can help you more, or, please, accept one answer (even if your one) 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 by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 15:45:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Why-are-results-different-if-my-search-is-used-in-the-dashboard/m-p/696970#M57137</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-08-21T15:45:38Z</dc:date>
    </item>
  </channel>
</rss>

