<?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: How to use inputlookup output as parameter in streaming command? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-inputlookup-output-as-parameter-in-streaming-command/m-p/326001#M21059</link>
    <description>&lt;P&gt;@DalJeanis It works perfectly when I 'hardcode' the values like this:&lt;/P&gt;

&lt;P&gt;| getmanagerlogs 10.0.0.90 8000 10.0.0.50 55000 foo bar&lt;BR /&gt;
 | table timestamp, tag, level, description &lt;BR /&gt;
 | search  level=$value$&lt;/P&gt;

&lt;P&gt;Which are the exactly values that | inputlookup kvstore_lookup | returns.&lt;/P&gt;

&lt;P&gt;Thank you for your reply&lt;/P&gt;</description>
    <pubDate>Tue, 10 Apr 2018 17:07:17 GMT</pubDate>
    <dc:creator>wazuhtest</dc:creator>
    <dc:date>2018-04-10T17:07:17Z</dc:date>
    <item>
      <title>How to use inputlookup output as parameter in streaming command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-inputlookup-output-as-parameter-in-streaming-command/m-p/325999#M21057</link>
      <description>&lt;P&gt;I have only one KVstore row for storing session data, and I need that fields as arguments for streaming commands along the whole app. Example:&lt;/P&gt;

&lt;P&gt;I have one row (I only need one) with session data here:   &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup kvstore_lookup | table baseip ,baseport,ipapi,portapi,userapi,passapi |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And I would need to use those fields as arguments in the following streaming command search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| getmanagerlogs $baseip$ $baseport$ $ipapi$ $portapi$ $userapi$ $passapi$  | table timestamp, tag, level, description |
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I tried to do is the following:&lt;BR /&gt;
- First of all, in the dashboard,I bring kvstore_lookup data via http with $ajax, and set the token values in the callback like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;$(document).ready(function(){
             service.request(
                 "storage/collections/data/credentials/",
                 "GET",
                 null,
                 null,
                 null,
                 {"Content-Type": "application/json"},null
             ).done(function(data) { 
                 console.log(data)
                 setToken('baseip',data[0].baseip);
                 setToken('baseport',data[0].baseport);
                 setToken('ipapi',data[0].ipapi);
                 setToken('portapi',data[0].portapi);
                 setToken('userapi',data[0].userapi);
                 setToken('passwordapi',data[0].passwordapi);
            });
         });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But it seems like the search is loaded before that callback is invoked:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;var search1 = new SearchManager({
          "id": "search1",
          "search": "| getmanagerlogs $baseip$ $baseport$ $ipapi$ $portapi$ $userapi$ $passwordapi$ | table timestamp, tag, level, description | search  level=$value$",
          "status_buckets": 0,
          "earliest_time": "-24h@h",
          "cancelOnUnload": true,
          "sample_ratio": null,
          "latest_time": "now",
          "app": utils.getCurrentApp(),
          "auto_cancel": 90,
          "preview": true,
          "tokenDependencies": {
          },
          "runWhenTimeIsUndefined": false
        }, { tokens: true, tokenNamespace: "submitted" });
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I thought something about crossing or joining both queries, but I wasn't able to make it work also.&lt;BR /&gt;
Any help will be much appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 15:28:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-inputlookup-output-as-parameter-in-streaming-command/m-p/325999#M21057</guid>
      <dc:creator>wazuhtest</dc:creator>
      <dc:date>2018-04-10T15:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use inputlookup output as parameter in streaming command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-inputlookup-output-as-parameter-in-streaming-command/m-p/326000#M21058</link>
      <description>&lt;P&gt;First, what happens when you fill in this search with the values and run it?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| getmanagerlogs $baseip$ $baseport$ $ipapi$ $portapi$ $userapi$ $passwordapi$ 
| table timestamp, tag, level, description 
| search  level=$value$
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Second, are the values in &lt;CODE&gt;$baseip$&lt;/CODE&gt; (for example) supposed to be formatted as &lt;CODE&gt;1.1.1.1&lt;/CODE&gt; OR as &lt;CODE&gt;baseip=1.1.1.1&lt;/CODE&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 16:53:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-inputlookup-output-as-parameter-in-streaming-command/m-p/326000#M21058</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2018-04-10T16:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to use inputlookup output as parameter in streaming command?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-inputlookup-output-as-parameter-in-streaming-command/m-p/326001#M21059</link>
      <description>&lt;P&gt;@DalJeanis It works perfectly when I 'hardcode' the values like this:&lt;/P&gt;

&lt;P&gt;| getmanagerlogs 10.0.0.90 8000 10.0.0.50 55000 foo bar&lt;BR /&gt;
 | table timestamp, tag, level, description &lt;BR /&gt;
 | search  level=$value$&lt;/P&gt;

&lt;P&gt;Which are the exactly values that | inputlookup kvstore_lookup | returns.&lt;/P&gt;

&lt;P&gt;Thank you for your reply&lt;/P&gt;</description>
      <pubDate>Tue, 10 Apr 2018 17:07:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-use-inputlookup-output-as-parameter-in-streaming-command/m-p/326001#M21059</guid>
      <dc:creator>wazuhtest</dc:creator>
      <dc:date>2018-04-10T17:07:17Z</dc:date>
    </item>
  </channel>
</rss>

