<?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: Javascript SDK (Nodejs) How should I write my search string to search based on host? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Javascript-SDK-Nodejs-How-should-I-write-my-search-string-to/m-p/158850#M44787</link>
    <description>&lt;P&gt;Ah, missed one combination and that is the answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks.&lt;/P&gt;</description>
    <pubDate>Tue, 28 Apr 2015 04:01:00 GMT</pubDate>
    <dc:creator>blazergun</dc:creator>
    <dc:date>2015-04-28T04:01:00Z</dc:date>
    <item>
      <title>Javascript SDK (Nodejs) How should I write my search string to search based on host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Javascript-SDK-Nodejs-How-should-I-write-my-search-string-to/m-p/158848#M44785</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I have Splunk running on my machine. I am using Nodejs (Javascript sdk) to search a query. I am using oneshotSearch to get all the results I want.&lt;/P&gt;

&lt;P&gt;Through the web interface, I can run a very simple query &lt;CODE&gt;host=V-MacBook-Pro.local&lt;/CODE&gt; and this returns me results. I want to search based on &lt;CODE&gt;host=&lt;/CODE&gt;, because in the real dev environment, I might have logs aggregated and I need to filter out based on host.&lt;/P&gt;

&lt;P&gt;This query does not run in my code. &lt;BR /&gt;
In my code var searchQuery = "_host=V-MacBook-Pro.local" throws up: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[SPLUNKD] Error in 'SearchParser': Missing a search command before '_'. Error at position '0' of search query '_host=V-MacBook-Pro.local'.
Error with "host=V-MacBook-Pro.local" and no result with "search _host=V-MacBook-Pro.local". 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How exactly should my search string be to search based on "host" ?&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 03:36:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Javascript-SDK-Nodejs-How-should-I-write-my-search-string-to/m-p/158848#M44785</guid>
      <dc:creator>blazergun</dc:creator>
      <dc:date>2015-04-28T03:36:56Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript SDK (Nodejs) How should I write my search string to search based on host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Javascript-SDK-Nodejs-How-should-I-write-my-search-string-to/m-p/158849#M44786</link>
      <description>&lt;P&gt;search host=V-MacBook-Pro.local&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 03:53:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Javascript-SDK-Nodejs-How-should-I-write-my-search-string-to/m-p/158849#M44786</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-28T03:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Javascript SDK (Nodejs) How should I write my search string to search based on host?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Javascript-SDK-Nodejs-How-should-I-write-my-search-string-to/m-p/158850#M44787</link>
      <description>&lt;P&gt;Ah, missed one combination and that is the answer &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 04:01:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Javascript-SDK-Nodejs-How-should-I-write-my-search-string-to/m-p/158850#M44787</guid>
      <dc:creator>blazergun</dc:creator>
      <dc:date>2015-04-28T04:01:00Z</dc:date>
    </item>
  </channel>
</rss>

