<?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: Creating a token in first search and passing it on to append search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-token-in-first-search-and-passing-it-on-to-append/m-p/571820#M199267</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes concatinating the search string entirely out of tokens is possible and i already use it for standard charts that only differ in a metric or so...make the code much slimmer. However this would mean that the Visualization search is triggered each time that a sub token is filled or it displays depending on the ofset errors or no results found...However this procedure makes the Visualization rather...flickery as the one append relies of a token from the previous append or main search. So if i have 3 sub searches the charts loads about 3 times just for one search.&lt;/P&gt;</description>
    <pubDate>Thu, 21 Oct 2021 13:36:00 GMT</pubDate>
    <dc:creator>Software-Simian</dc:creator>
    <dc:date>2021-10-21T13:36:00Z</dc:date>
    <item>
      <title>Creating a token in first search and passing it on to append search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-token-in-first-search-and-passing-it-on-to-append/m-p/571807#M199260</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;i am trying to create a dependency map without the external creation of tokens that are being fed to the append searches.&lt;/P&gt;&lt;P&gt;Here is the motive:&lt;/P&gt;&lt;P&gt;I have a list of Sources and Targets, where as the Source of one Relation is the Target of many others and so on. This is recursive, but i would stop at 4 iterations for now &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; )&lt;BR /&gt;The resulting table must only have the pairs of Source and Target Services as basis for the visualization.&lt;BR /&gt;&lt;BR /&gt;&lt;U&gt;The first search looks something like this:&lt;/U&gt;&lt;BR /&gt;index=poc_analyze_something_rather Target_Service=$my_initial_token_from dashboard$&lt;BR /&gt;| &lt;FONT color="#0000FF"&gt;table&lt;/FONT&gt; Source_Service Target_Service&lt;BR /&gt;&lt;BR /&gt;The initial token is being fed via drilldown from the dashboard. So far no issue at all. So the first search creates the list of Source_Services connected to the Target_Service (token).&lt;BR /&gt;&lt;BR /&gt;Now i have actually two issues...sorry...&lt;BR /&gt;First is that i cannot create the table of the pairs and create a token at the same time.&lt;/P&gt;&lt;P&gt;&lt;U&gt;The creation of the token would look something like this:&lt;/U&gt;&lt;BR /&gt;index=poc_analyze_something_rather Target_Service=$my_initial_token_from dashboard$&lt;BR /&gt;| &lt;FONT color="#0000ff"&gt;stats &lt;FONT color="#000000"&gt;&lt;FONT color="#FF00FF"&gt;values&lt;/FONT&gt;(Source_Service) as results | eval&amp;nbsp;list_of_Source_Services_search_one = &lt;FONT color="#FF00FF"&gt;mvjoin&lt;/FONT&gt;(results, ",")&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;So the first issue is how to team them up in one search if possible&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;The second issue starts once i have the token. The second search would look something like that:&lt;BR /&gt;| &lt;FONT color="#0000FF"&gt;append&lt;/FONT&gt; [ | &lt;FONT color="#0000FF"&gt;search&lt;/FONT&gt;&lt;BR /&gt;index=poc_analyze_something_rather Target_Service IN($list_of_Source_Services_Search_one$)&lt;BR /&gt;| &lt;FONT color="#0000FF"&gt;table&lt;/FONT&gt; Source_Service Target_Service&lt;BR /&gt;]&lt;BR /&gt;&lt;BR /&gt;However the first search does not seem to pass the token along into the append search.&lt;BR /&gt;It is no issue at all if i make a search in the dashboard (no visualization) like this to create the token:&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;&lt;FONT color="#000000"&gt;&amp;lt;search&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;query&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; index=poc_analyze_something_rather Target_Service=$my_initial_token_from dashboard$&lt;BR /&gt;&amp;nbsp; &amp;nbsp; | stats &lt;FONT color="#FF00FF"&gt;values&lt;/FONT&gt;(Source_Service) as results | eval source_list= &lt;FONT color="#FF00FF"&gt;mvjoin&lt;/FONT&gt;(results, ",")&lt;BR /&gt;&amp;nbsp; &amp;lt;/query&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;done&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;set token="list_of_Source_Services_Search_one"&amp;gt;$result.source_list$&amp;lt;/set&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/done&amp;gt;&lt;BR /&gt;&amp;lt;/search&amp;gt;&lt;BR /&gt;&lt;BR /&gt;The append search has no issues at all with this token. However there must be a way to create the list the Source and Targets without resulting to a dashboard with xml coded searches.&lt;BR /&gt;&lt;BR /&gt;Any idea?&lt;BR /&gt;&lt;BR /&gt;Thanks Mike&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 12:08:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-token-in-first-search-and-passing-it-on-to-append/m-p/571807#M199260</guid>
      <dc:creator>Software-Simian</dc:creator>
      <dc:date>2021-10-21T12:08:37Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a token in first search and passing it on to append search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-token-in-first-search-and-passing-it-on-to-append/m-p/571816#M199264</link>
      <description>&lt;P&gt;There is no passing of tokens/fields into subsearches in SPL.&amp;nbsp; The only exception is with the &lt;FONT face="courier new,courier"&gt;map&lt;/FONT&gt; command.&lt;/P&gt;&lt;P&gt;Sometimes, one can work around this by refactoring the search so the token is created in a subsearch and passed OUT to the main search.&amp;nbsp; That probably won't work in this case so a dashboard is the way to go.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 13:25:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-token-in-first-search-and-passing-it-on-to-append/m-p/571816#M199264</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-10-21T13:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a token in first search and passing it on to append search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Creating-a-token-in-first-search-and-passing-it-on-to-append/m-p/571820#M199267</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;thanks for the response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes concatinating the search string entirely out of tokens is possible and i already use it for standard charts that only differ in a metric or so...make the code much slimmer. However this would mean that the Visualization search is triggered each time that a sub token is filled or it displays depending on the ofset errors or no results found...However this procedure makes the Visualization rather...flickery as the one append relies of a token from the previous append or main search. So if i have 3 sub searches the charts loads about 3 times just for one search.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Oct 2021 13:36:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Creating-a-token-in-first-search-and-passing-it-on-to-append/m-p/571820#M199267</guid>
      <dc:creator>Software-Simian</dc:creator>
      <dc:date>2021-10-21T13:36:00Z</dc:date>
    </item>
  </channel>
</rss>

