<?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: Why am I unable to add my search to a dashboard panel? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261009#M78323</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am unsure of how to add the correct FirstEvent and LastEvent time in, but for the search in which you are looking for, I would use a tstats command similar to below to return the desired results.&lt;/P&gt;

&lt;P&gt;To group every sourcetype by its index use the search below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count WHERE index=* by index sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To group the sourcetypes by index use the below search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count values(sourcetype) WHERE index=* by index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With this search it should populate your dashboard without a problem. You would just have to further investigate adding the first and last event times.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2017 03:16:00 GMT</pubDate>
    <dc:creator>bmo017</dc:creator>
    <dc:date>2017-01-26T03:16:00Z</dc:date>
    <item>
      <title>Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261008#M78322</link>
      <description>&lt;P&gt;I am using the following search to get all indexes and sourcetypes. But I am unable to add the search to a dashboard panel. XML seems to escape the text correctly but doesn't bring back any results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eventcount summarize=false index=* index!=_* | dedup index | fields index 
     | map maxsearches=100 search="| metadata type=sourcetypes index=\"$index$\" | eval retention=tostring(abs(lastTime-firstTime), \"duration\") | convert ctime(firstTime) ctime(lastTime) | sort lastTime | rename totalCount AS \"TotalEvents\" firstTime AS \"FirstEvent\" lastTime AS \"LastEvent\" | eval index=\"$index$\"" | rename index as "Index" "sourcetype" as "SourceType" | fields Index  SourceType TotalEvents FirstEvent LastEvent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Jan 2017 02:23:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261008#M78322</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2017-01-26T02:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261009#M78323</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I am unsure of how to add the correct FirstEvent and LastEvent time in, but for the search in which you are looking for, I would use a tstats command similar to below to return the desired results.&lt;/P&gt;

&lt;P&gt;To group every sourcetype by its index use the search below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count WHERE index=* by index sourcetype
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;To group the sourcetypes by index use the below search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count values(sourcetype) WHERE index=* by index
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;With this search it should populate your dashboard without a problem. You would just have to further investigate adding the first and last event times.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 03:16:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261009#M78323</guid>
      <dc:creator>bmo017</dc:creator>
      <dc:date>2017-01-26T03:16:00Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261010#M78324</link>
      <description>&lt;P&gt;Do you have the input created correctly? I added this to a dashboard panel exactly as written and added in an input for index and it seems to work just fine.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 12:44:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261010#M78324</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-01-26T12:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261011#M78325</link>
      <description>&lt;P&gt;Oh, I see the data after adding the input. But do I get to display it all indexes and sourcetypes&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 13:53:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261011#M78325</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2017-01-26T13:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261012#M78326</link>
      <description>&lt;P&gt;The only problem is tstats command is timebound. In order to look for all indexes and sourcetypes, I have select "All Time" which is taking lot of time to return the results.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 13:56:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261012#M78326</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2017-01-26T13:56:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261013#M78327</link>
      <description>&lt;P&gt;it's seeing the &lt;CODE&gt;| metadata type=sourcetypes index=\"$index$\"&lt;/CODE&gt; and &lt;CODE&gt;| eval index=\"$index$\""&lt;/CODE&gt; as a token. Just add an input and just have it always set to &lt;CODE&gt;*&lt;/CODE&gt; if wanted.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 14:11:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261013#M78327</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-01-26T14:11:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261014#M78328</link>
      <description>&lt;P&gt;I am unable to set it to "*"&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 14:13:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261014#M78328</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2017-01-26T14:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261015#M78329</link>
      <description>&lt;P&gt;try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;test2&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="radio" token="index"&amp;gt;
      &amp;lt;label&amp;gt;index&amp;lt;/label&amp;gt;
      &amp;lt;choice value="\&amp;amp;quot;$index$\&amp;amp;quot;"&amp;gt;all&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;| eventcount summarize=false index=* index!=_* | dedup index | fields index 
      | map maxsearches=100 search="| metadata type=sourcetypes index=\"$index$\" | eval retention=tostring(abs(lastTime-firstTime), \"duration\") | convert ctime(firstTime) ctime(lastTime) | sort lastTime | rename totalCount AS \"TotalEvents\" firstTime AS \"FirstEvent\" lastTime AS \"LastEvent\" | eval index=\"$index$\"" | rename index as "Index" "sourcetype" as "SourceType" | fields Index  SourceType TotalEvents FirstEvent LastEvent&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-3d@d&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;100&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;cell&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/form&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 Jan 2017 14:18:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261015#M78329</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-01-26T14:18:48Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261016#M78330</link>
      <description>&lt;P&gt;With this query, is it possible to filter on both indexes and sourcetypes? So the above query lists all indexes and sourcetype....I have those in hundreds.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 14:23:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261016#M78330</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2017-01-26T14:23:37Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261017#M78331</link>
      <description>&lt;P&gt;you could change/add to the input to filter, I believe.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2017 14:35:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261017#M78331</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-01-26T14:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261018#M78332</link>
      <description>&lt;P&gt;I opened up a separate question for my filters. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 01:42:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261018#M78332</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2017-01-27T01:42:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261019#M78333</link>
      <description>&lt;P&gt;How I hide the input?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2017 03:02:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261019#M78333</guid>
      <dc:creator>jagadeeshm</dc:creator>
      <dc:date>2017-01-27T03:02:08Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I unable to add my search to a dashboard panel?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261020#M78334</link>
      <description>&lt;P&gt;add this to the form statement&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;form hideFilters="true"&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Jan 2017 12:48:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-unable-to-add-my-search-to-a-dashboard-panel/m-p/261020#M78334</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-01-27T12:48:59Z</dc:date>
    </item>
  </channel>
</rss>

