<?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: savedsearch command replace with a literal string not working in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/510566#M142906</link>
    <description>&lt;P&gt;Tokens in dashboards are variables and when used, are surrounded with $xxx$, which I am sure you know, however, a similar construct is used in the saved search command&lt;/P&gt;&lt;P&gt;| savedsearch Name key="value"&lt;/P&gt;&lt;P&gt;but these key value pairs are not 'tokens'. The savedsearch doc refers to them as "&lt;SPAN&gt;replacement placeholder terms"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, in your saved search/report you would then surround your replacement term with quotes, so I believe in your example your saved search should be using&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;base search &amp;gt; |  search subject="$emailsubject_tok$"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is how I am using those terms, surrounded with quotes and I have no problems using these when they contain spaces.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 23 Jul 2020 03:49:42 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2020-07-23T03:49:42Z</dc:date>
    <item>
      <title>savedsearch command replace with a literal string not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/509773#M142485</link>
      <description>&lt;P&gt;Hi using a Report (cause I need to allow permissions to the data) in a dashboard passing tokens. Looking at the docs, I can use "savedsearch" command&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Savedsearch" target="_blank" rel="noopener"&gt;https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Savedsearch&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|  savedsearch "MyReport" emailsubject_tok="Long Subject Name with + | and spaces"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I look at the job log, only the first word is being replaced. So for my example, the job log shows emailsubject_tok as "Long".&amp;nbsp; How can I pass this in as a literal string? Trying not to modify the string itself as this will be a user cutting and pasting email subject text.&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Chris&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 18:51:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/509773#M142485</guid>
      <dc:creator>chrisboy68</dc:creator>
      <dc:date>2020-07-17T18:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: savedsearch command replace with a literal string not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/510334#M142830</link>
      <description>&lt;P&gt;Is that saved search command the &amp;lt;query&amp;gt; element in a dashboard?&lt;/P&gt;&lt;P&gt;If so, how is the emailsubject_tok value getting there, is it from a token?&lt;/P&gt;&lt;P&gt;I have a similar saved search and it is working fine like this, i.e. the token is appearing in the saved search as the correct data. Both of these work&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;query&amp;gt;| savedsearch MySavedSearch device_key="$device_key$"&amp;lt;/query&amp;gt;

&amp;lt;query&amp;gt;| savedsearch MySavedSearch device_key="Long Subject Name with + | and spaces"&amp;lt;/query&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;I am not quoting my saved search name, which is not necessary if it's a single word.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 03:08:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/510334#M142830</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-07-22T03:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: savedsearch command replace with a literal string not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/510475#M142870</link>
      <description>&lt;P&gt;HI, thanks for the reply. It is getting populated through the dashboard, but I'm trying to do it via the console and running into issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| savedsearch "SavedSearches With Spaces" emailsubject_tok="Long Subject Name with + | and spaces"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;emailsubject_tok is in the report like.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;base search &amp;gt; |  search subject=$emailsubject_tok$ &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe I'm messing up my quotes. Are you able to use the command with a search and token that contains spaces? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 14:53:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/510475#M142870</guid>
      <dc:creator>chrisboy68</dc:creator>
      <dc:date>2020-07-22T14:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: savedsearch command replace with a literal string not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/510566#M142906</link>
      <description>&lt;P&gt;Tokens in dashboards are variables and when used, are surrounded with $xxx$, which I am sure you know, however, a similar construct is used in the saved search command&lt;/P&gt;&lt;P&gt;| savedsearch Name key="value"&lt;/P&gt;&lt;P&gt;but these key value pairs are not 'tokens'. The savedsearch doc refers to them as "&lt;SPAN&gt;replacement placeholder terms"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So, in your saved search/report you would then surround your replacement term with quotes, so I believe in your example your saved search should be using&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;base search &amp;gt; |  search subject="$emailsubject_tok$"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is how I am using those terms, surrounded with quotes and I have no problems using these when they contain spaces.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hope this works.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 03:49:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/510566#M142906</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-07-23T03:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: savedsearch command replace with a literal string not working</title>
      <link>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/510648#M142951</link>
      <description>&lt;P&gt;Oh my, that was it. I needed to quote the token string in the Report/saved search!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 12:54:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/savedsearch-command-replace-with-a-literal-string-not-working/m-p/510648#M142951</guid>
      <dc:creator>chrisboy68</dc:creator>
      <dc:date>2020-07-23T12:54:39Z</dc:date>
    </item>
  </channel>
</rss>

