<?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: i am reading from log file and have query to return all the host. can we include teh step to categories test/qa/prod in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/i-am-reading-from-log-file-and-have-query-to-return-all-the-host/m-p/684294#M56021</link>
    <description>&lt;P&gt;Here's a simple example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1"&amp;gt;
  &amp;lt;label&amp;gt;HostDropdown&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="hosts" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Host Types&amp;lt;/label&amp;gt;
      &amp;lt;choice value="prodhost*"&amp;gt;Production&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="qahost*"&amp;gt;QA&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="testhost*"&amp;gt;Test&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;
index=aaa source="/var/log/test1.log" host=$hosts$
|stats count by host
          &amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&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;/LI-CODE&gt;&lt;P&gt;I suggest you look at this and have a look through the documentation that describes this&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 15 Apr 2024 22:35:09 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2024-04-15T22:35:09Z</dc:date>
    <item>
      <title>i am reading from log file and have query to return all the host. can we include teh step to categories test/qa/prod in</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/i-am-reading-from-log-file-and-have-query-to-return-all-the-host/m-p/683846#M55978</link>
      <description>&lt;P&gt;i am reading teh host from log file and have query to return all the host.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=aaa  source="/var/log/test1.log"|stats count by host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;can we include teh step to categories test/qa/prod in the drop down list&amp;nbsp; from the list of host returned in the query itself?(using wildcard if host has t then test /if host has q -qa server, etc?&lt;/P&gt;&lt;P&gt;but for now i am using static options&amp;nbsp;&lt;/P&gt;&lt;P&gt;test - testhost&lt;/P&gt;&lt;P&gt;qa - qahost&lt;/P&gt;&lt;P&gt;prod - prodhost&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2024 18:44:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/i-am-reading-from-log-file-and-have-query-to-return-all-the-host/m-p/683846#M55978</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2024-04-10T18:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: i am reading from log file and have query to return all the host. can we include teh step to categories test/qa/prod</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/i-am-reading-from-log-file-and-have-query-to-return-all-the-host/m-p/683863#M55979</link>
      <description>&lt;P&gt;You can use the populating search of the drop down to add dynamic options and do something like this to categorise the host type&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=aaa  source="/var/log/test1.log"
|stats count by host
| eval category=case(match(host, "t"), "Test", 
                     match(host, "q"), "QA", 
                     match(host, "p"), "Prod",
                     true(), "Unknown")&lt;/LI-CODE&gt;&lt;P&gt;change the match statement regex as needed and the category you want to show.&lt;/P&gt;&lt;P&gt;category will be the &amp;lt;&lt;STRONG&gt;fieldForLabel&lt;/STRONG&gt;&amp;gt; and then you need to make the &amp;lt;&lt;STRONG&gt;fieldForValue&lt;/STRONG&gt;&amp;gt; to contain the value element you want for the token.&lt;/P&gt;</description>
      <pubDate>Thu, 11 Apr 2024 00:24:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/i-am-reading-from-log-file-and-have-query-to-return-all-the-host/m-p/683863#M55979</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-11T00:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: i am reading from log file and have query to return all the host. can we include teh step to categories test/qa/prod</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/i-am-reading-from-log-file-and-have-query-to-return-all-the-host/m-p/684066#M55997</link>
      <description>&lt;P&gt;in QA and PROd i have 3 servers&lt;/P&gt;
&lt;P&gt;test - testhost&lt;/P&gt;
&lt;P&gt;qa - qahost1,qahost2,qahost3&lt;/P&gt;
&lt;P&gt;prod - prodhost1,prodhost2,prodhost3&lt;/P&gt;
&lt;P&gt;and my query would be for qa if i choose qa from dropdownlist&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=aaa(source="/var/log/tes1.log" (host=qahost1) OR (host=qahost2,) OR (host=qahost3) )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;can you please help me integrate above one with below query?&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=aaa source="/var/log/test1.log"
|stats count by host
| eval category=case(match(host, "t"), "Test",
match(host, "q"), "QA",
match(host, "p"), "Prod",
true(), "Unknown")&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 12 Apr 2024 18:46:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/i-am-reading-from-log-file-and-have-query-to-return-all-the-host/m-p/684066#M55997</guid>
      <dc:creator>Jasmine</dc:creator>
      <dc:date>2024-04-12T18:46:55Z</dc:date>
    </item>
    <item>
      <title>Re: i am reading from log file and have query to return all the host. can we include teh step to categories test/qa/prod</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/i-am-reading-from-log-file-and-have-query-to-return-all-the-host/m-p/684294#M56021</link>
      <description>&lt;P&gt;Here's a simple example&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form version="1.1"&amp;gt;
  &amp;lt;label&amp;gt;HostDropdown&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="hosts" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;Host Types&amp;lt;/label&amp;gt;
      &amp;lt;choice value="prodhost*"&amp;gt;Production&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="qahost*"&amp;gt;QA&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="testhost*"&amp;gt;Test&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;
index=aaa source="/var/log/test1.log" host=$hosts$
|stats count by host
          &amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$earliest$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;$latest$&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&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;/LI-CODE&gt;&lt;P&gt;I suggest you look at this and have a look through the documentation that describes this&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML" target="_blank"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Viz/PanelreferenceforSimplifiedXML&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 22:35:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/i-am-reading-from-log-file-and-have-query-to-return-all-the-host/m-p/684294#M56021</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2024-04-15T22:35:09Z</dc:date>
    </item>
  </channel>
</rss>

