<?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 is host=myhost giving no results? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462977#M79920</link>
    <description>&lt;P&gt;Splunk configures &lt;STRONG&gt;index = default&lt;/STRONG&gt; when you add new monitor. And &lt;STRONG&gt;default&lt;/STRONG&gt; index is not created in indexer servers. So you need to specify index and sourcetype for your monitor. Edit  &lt;STRONG&gt;/apps/splunkforwarder/etc/apps/search/local/inputs.conf&lt;/STRONG&gt; and add index and sourcetype like below. Restart splunk forwarder and check data in &lt;CODE&gt;index=main sourcetype=foo&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log/foo/]
index = main
sourcetype = foo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As @woodcock suggested. Instead of updating splunk internal search app it is better to put inputs.conf in your own add-on and deploy it. Move &lt;STRONG&gt;/apps/splunkforwarder/etc/apps/search/local/inputs.conf&lt;/STRONG&gt; file to &lt;STRONG&gt;/apps/splunkforwarder/etc/apps/fwd-2-dev-indexers/default/&lt;/STRONG&gt; and restart splunk forwarder.&lt;/P&gt;</description>
    <pubDate>Thu, 02 Apr 2020 11:03:18 GMT</pubDate>
    <dc:creator>manjunathmeti</dc:creator>
    <dc:date>2020-04-02T11:03:18Z</dc:date>
    <item>
      <title>Why is host=myhost giving no results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462970#M79913</link>
      <description>&lt;P&gt;Sorry for the complete noob question.  But I have had this splunk project dropped on me and I need to spin up fast.&lt;/P&gt;

&lt;P&gt;I have added a monitor on "myhost" like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[root@myhost bin]# pwd
/apps/splunkforwarder/bin
[root@myhost bin]# ./splunk add monitor /var/log/foo/
Your session is invalid.  Please login.
Splunk username: admin
Password:
Added monitor of '/var/log/foo'.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That was yesterday.&lt;BR /&gt;&lt;BR /&gt;
I executed a script that writes data to a log file that is in the /var/log/foo directory on myhost.&lt;BR /&gt;
But when I execute this search &lt;CODE&gt;host=myhost&lt;/CODE&gt; I get zero results.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 19:26:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462970#M79913</guid>
      <dc:creator>iiooiiooiioo</dc:creator>
      <dc:date>2020-04-01T19:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why is host=myhost giving no results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462971#M79914</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
Since you didnt specify an index, splunk will, by default, place your data in the 'main' index. The server would check in under its hostname/ip address so you could this in your host= parameter. &lt;/P&gt;

&lt;P&gt;So you could try &lt;CODE&gt;index=main host=&amp;lt;myhost&amp;gt; or &amp;lt;ipdress&amp;gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If you want to find out the hsotname of the forwarder: &lt;CODE&gt;./splunk show default-hostname&lt;/CODE&gt;&lt;BR /&gt;
then pass this hostname in your search: &lt;CODE&gt;index=main host=&amp;lt;output_of_above_command&amp;gt;&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;Best practice is to simply create an inputs.conf file either under /system/local or /etc/apps//local and monitor files that way assuming you have configured the outputs.conf to send data to the indexers (unless standalone-all-in-one box).&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 19:59:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462971#M79914</guid>
      <dc:creator>mguhad</dc:creator>
      <dc:date>2020-04-01T19:59:07Z</dc:date>
    </item>
    <item>
      <title>Re: Why is host=myhost giving no results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462972#M79915</link>
      <description>&lt;P&gt;Never use the CLI for this.  Create a &lt;CODE&gt;$SPLUNK_HOME/etc/varlog_inputs/default/inputs.conf&lt;/CODE&gt; file like this:&lt;BR /&gt;
&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Data/Monitorfilesanddirectories"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Data/Monitorfilesanddirectories&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 20:12:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462972#M79915</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-04-01T20:12:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why is host=myhost giving no results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462973#M79916</link>
      <description>&lt;P&gt;Thanks for the reply.  But I do not seem to have the varlog_input directory on my server:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[root@myhost etc]# pwd
/apps/splunkforwarder/etc
[root@myhost etc]# ls -l | grep varlog
[root@myhost etc]#
[root@myhost etc]# env | grep -i SPLUNK_HOME
[root@myhost etc]#
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Apr 2020 20:24:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462973#M79916</guid>
      <dc:creator>iiooiiooiioo</dc:creator>
      <dc:date>2020-04-01T20:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why is host=myhost giving no results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462974#M79917</link>
      <description>&lt;P&gt;Thanks for the reply!&lt;/P&gt;

&lt;P&gt;Here's what I tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[root@myhost bin]# ./splunk show default-hostname
Default hostname for data inputs: myhost.
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then I tried this search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main host=myhost
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I still got no results.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Apr 2020 20:27:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462974#M79917</guid>
      <dc:creator>iiooiiooiioo</dc:creator>
      <dc:date>2020-04-01T20:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why is host=myhost giving no results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462975#M79918</link>
      <description>&lt;P&gt;Here is an update to my original post.  Here are the locations of the inputs.conf and outputs.conf file I have on "myhost":&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[root@myhost splunkforwarder]# pwd
/apps/splunkforwarder
[root@myhost splunkforwarder]# find . -name inputs.conf
./etc/system/default/inputs.conf
./etc/system/local/inputs.conf
./etc/apps/search/local/inputs.conf
./etc/apps/SplunkUniversalForwarder/default/inputs.conf
./etc/apps/introspection_generator_addon/default/inputs.conf
./etc/apps/splunk_httpinput/default/inputs.conf
[root@myhost splunkforwarder]# find . -name outputs.conf
./etc/system/default/outputs.conf
./etc/apps/SplunkUniversalForwarder/default/outputs.conf
./etc/apps/fwd-2-dev-indexers/default/outputs.conf
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 01 Apr 2020 20:33:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462975#M79918</guid>
      <dc:creator>iiooiiooiioo</dc:creator>
      <dc:date>2020-04-01T20:33:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why is host=myhost giving no results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462976#M79919</link>
      <description>&lt;P&gt;@iiooiiooiioo cheeck if your forwarder (myhost)  are actually sending data at all to the _internal index.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal host=myhost
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;ALternatively, check to see if the main index has ANY data :&lt;BR /&gt;
    | eventcount summarize=false index=* OR index=_*&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 10:14:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462976#M79919</guid>
      <dc:creator>mguhad</dc:creator>
      <dc:date>2020-04-02T10:14:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why is host=myhost giving no results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462977#M79920</link>
      <description>&lt;P&gt;Splunk configures &lt;STRONG&gt;index = default&lt;/STRONG&gt; when you add new monitor. And &lt;STRONG&gt;default&lt;/STRONG&gt; index is not created in indexer servers. So you need to specify index and sourcetype for your monitor. Edit  &lt;STRONG&gt;/apps/splunkforwarder/etc/apps/search/local/inputs.conf&lt;/STRONG&gt; and add index and sourcetype like below. Restart splunk forwarder and check data in &lt;CODE&gt;index=main sourcetype=foo&lt;/CODE&gt;.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[monitor:///var/log/foo/]
index = main
sourcetype = foo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As @woodcock suggested. Instead of updating splunk internal search app it is better to put inputs.conf in your own add-on and deploy it. Move &lt;STRONG&gt;/apps/splunkforwarder/etc/apps/search/local/inputs.conf&lt;/STRONG&gt; file to &lt;STRONG&gt;/apps/splunkforwarder/etc/apps/fwd-2-dev-indexers/default/&lt;/STRONG&gt; and restart splunk forwarder.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 11:03:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462977#M79920</guid>
      <dc:creator>manjunathmeti</dc:creator>
      <dc:date>2020-04-02T11:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is host=myhost giving no results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462978#M79921</link>
      <description>&lt;P&gt;Yes, you will be creating a custom app called anything that you like. I made up &lt;CODE&gt;varlog_inputs&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 02 Apr 2020 14:34:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/462978#M79921</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2020-04-02T14:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Why is host=myhost giving no results?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/657111#M111269</link>
      <description>&lt;P&gt;Im having the same issue as ownerpost I tried your index=_internal host=___ I typed in my agent1 , agent2 and agent3 along with controller each tiime and data popped up for each 4 of them. but when I type in the command&amp;nbsp;&lt;SPAN&gt;Index=”main” host=* | table host | dedup host it does not show anything at all?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you help me troubleshoot this &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 10 Sep 2023 01:37:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-host-myhost-giving-no-results/m-p/657111#M111269</guid>
      <dc:creator>holowolf3500</dc:creator>
      <dc:date>2023-09-10T01:37:49Z</dc:date>
    </item>
  </channel>
</rss>

