Through the web interface, I can run a very simple query host=V-MacBook-Pro.local and this returns me results. I want to search based on host=, because in the real dev environment, I might have logs aggregated and I need to filter out based on host.
This query does not run in my code.
In my code var searchQuery = "_host=V-MacBook-Pro.local" throws up:
[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".
How exactly should my search string be to search based on "host" ?