<?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 get rid of the the spaces in token output? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586881#M204404</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;I also tried using a "static" value.&amp;nbsp; In all cases there is a space before and after&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If static value still cause space before and after, maybe they are introduced inadvertently in token prefix and suffix. &amp;nbsp;Inspect Simple XML Source ("Source" in editor), see if there are elements like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      &amp;lt;prefix&amp;gt; &amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt; &amp;lt;/suffix&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;in the &amp;lt;input/&amp;gt; entity. (I used this to simulate your condition when testing solution.)&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 28 Feb 2022 17:41:09 GMT</pubDate>
    <dc:creator>yuanliu</dc:creator>
    <dc:date>2022-02-28T17:41:09Z</dc:date>
    <item>
      <title>How to get rid of the the spaces in token output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586504#M204297</link>
      <description>&lt;P&gt;Trying to run a query that has a token field.&amp;nbsp; The output injects a space before and after the token provided keyword, which breaks the query..&amp;nbsp; Simple, but baffling.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Original query&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;|inputlookup somelookup.csv
| eval raw="" | foreach * [eval raw=raw.",".coalesce('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;',"") ] | search raw="*$token$*"
| table field1, field2, field3&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Output of query&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;|inputlookup somelookup.csv
| eval raw="" | foreach * [eval raw=raw.",".coalesce('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;',"") ] | search raw="* &amp;lt;keyword&amp;gt; *"
| table field1, field2, field3&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;How do I get rid of the spaces before and after the keyword?&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 22:43:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586504#M204297</guid>
      <dc:creator>tlmayes</dc:creator>
      <dc:date>2022-02-24T22:43:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to get rid of the the spaces in token output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586553#M204314</link>
      <description>&lt;P&gt;Although you may be able to rid the spaces &lt;EM&gt;after&lt;/EM&gt; they have been passed to your panel, it would be much better if you examine the input to figure out why the token has to pass spaces. &amp;nbsp;Are spaces expected in some other panels?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 08:09:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586553#M204314</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-25T08:09:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get rid of the the spaces in token output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586598#M204328</link>
      <description>&lt;P&gt;The query involves only two components:&amp;nbsp; an input keyword provided by a static list of tokens form a dashboard input, and the master lookup table in the original query.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 13:19:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586598#M204328</guid>
      <dc:creator>tlmayes</dc:creator>
      <dc:date>2022-02-25T13:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to get rid of the the spaces in token output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586642#M204341</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;The query involves only two components:&amp;nbsp; an input keyword provided by a static list of tokens form a dashboard input, and the master lookup table in the original query.&amp;nbsp;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Meaning that you cannot redo the static input? &amp;nbsp;Unless the spaces are useful in some context, why not get rid of them in input?&lt;/P&gt;&lt;P&gt;This said, a quick fix can be to switch from search to&amp;nbsp;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Where" target="_blank" rel="noopener"&gt;where&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;command,&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/TextFunctions#trim.28X.2CY.29" target="_blank" rel="noopener"&gt;trim()&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;spaces from $token$.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|inputlookup somelookup.csv
| eval raw="" | foreach * [eval raw=raw.",".coalesce('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;',"") ]
| where raw LIKE "%".trim("$token$")."%"
| table field1, field2, field3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 17:49:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586642#M204341</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-25T17:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to get rid of the the spaces in token output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586835#M204388</link>
      <description>&lt;P&gt;For all that responded, appreciate your responses.&amp;nbsp; I removed EVERYTHING between the '| inputputlook" call and the table output and replaced with something as simple as:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|inputlookup somelookup.csv
| search field1=$token$
| table field1, field2, field3&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;The output still contains a space before and after the token value.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;BTW, the original token value was a value pulled from a look.&amp;nbsp; I also tried using a "static" value.&amp;nbsp; In all cases there is a space before and after&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 12:36:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586835#M204388</guid>
      <dc:creator>tlmayes</dc:creator>
      <dc:date>2022-02-28T12:36:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to get rid of the the spaces in token output?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586881#M204404</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;I also tried using a "static" value.&amp;nbsp; In all cases there is a space before and after&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;If static value still cause space before and after, maybe they are introduced inadvertently in token prefix and suffix. &amp;nbsp;Inspect Simple XML Source ("Source" in editor), see if there are elements like&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      &amp;lt;prefix&amp;gt; &amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt; &amp;lt;/suffix&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;in the &amp;lt;input/&amp;gt; entity. (I used this to simulate your condition when testing solution.)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Feb 2022 17:41:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-rid-of-the-the-spaces-in-token-output/m-p/586881#M204404</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2022-02-28T17:41:09Z</dc:date>
    </item>
  </channel>
</rss>

