<?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 can I use a combination of map and sendemail to include spaces in the field values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110469#M28900</link>
    <description>&lt;P&gt;We meet the same issue too. Checked in the search log, it seems that the field with space are failed to be substitute. Anyone has idea about that?&lt;/P&gt;</description>
    <pubDate>Mon, 27 Apr 2015 09:28:13 GMT</pubDate>
    <dc:creator>karabsze</dc:creator>
    <dc:date>2015-04-27T09:28:13Z</dc:date>
    <item>
      <title>How can I use a combination of map and sendemail to include spaces in the field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110468#M28899</link>
      <description>&lt;P&gt;I have a search that uses the values in temp.csv file to generate an email for each row with specific values.&lt;/P&gt;

&lt;P&gt;Let's say the csv looks like this&lt;BR /&gt;
field1, field2&lt;BR /&gt;
john doe, blah&lt;BR /&gt;
bob smith, stuff&lt;/P&gt;

&lt;P&gt;The search looks like this (quotes within the subsearch are escaped, just not showing here):&lt;BR /&gt;
| inputlookup temp.csv | map search="| sendemail to=$field2$ subject=\"subject line\" from=&lt;A href="mailto:def@456.com"&gt;def@456.com&lt;/A&gt; message=\"test test $field1$ test test \""&lt;/P&gt;

&lt;P&gt;My problem is that when the field value (field1 in the search above) contains a space it stops populating the email after the space and sends it as is.  It doesn't seem to have an issue with spaces in text specified at search time.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Nov 2014 05:18:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110468#M28899</guid>
      <dc:creator>stembot</dc:creator>
      <dc:date>2014-11-11T05:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a combination of map and sendemail to include spaces in the field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110469#M28900</link>
      <description>&lt;P&gt;We meet the same issue too. Checked in the search log, it seems that the field with space are failed to be substitute. Anyone has idea about that?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Apr 2015 09:28:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110469#M28900</guid>
      <dc:creator>karabsze</dc:creator>
      <dc:date>2015-04-27T09:28:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a combination of map and sendemail to include spaces in the field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110470#M28901</link>
      <description>&lt;P&gt;Hi karabsze, I had this email from Splunk Support back on March 4th.&lt;/P&gt;

&lt;HR /&gt;

&lt;P&gt;Just an update on the issue.&lt;BR /&gt;
We have fixed the issue of handling variable name with quoted values inside the quotes. This will be included in the next maintance release, 6.1.8, scheduled in the 2nd half of May.&lt;BR /&gt;
Thank you for your patience on the matter, much appreciated and feel free to ask should you have any more questions on this.&lt;BR /&gt;
Best regards,&lt;/P&gt;

&lt;H2&gt;Sung | Splunk Support&lt;/H2&gt;

&lt;P&gt;I got around the original problem by just using the first name so never tested to see if the issue remained post-6.1.8.  Hope that helps.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2015 00:30:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110470#M28901</guid>
      <dc:creator>stembot</dc:creator>
      <dc:date>2015-04-28T00:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a combination of map and sendemail to include spaces in the field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110471#M28902</link>
      <description>&lt;P&gt;As a workaround you could probably do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup temp.csv | replace " " with "_" in field1 | map search="| sendemail to=$field2$ subject="subject line" from=def@456.com message="test test $field1$ test test ""
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Apr 2015 04:02:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110471#M28902</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-04-28T04:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a combination of map and sendemail to include spaces in the field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110472#M28903</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;

&lt;P&gt;I should have opened a new question but thought this is quite related. Hence adding to the thread.&lt;BR /&gt;
I am trying to do something similar but the challenge I am seeing that everytime the message is going as literal text string and doesn't look very nicely formatted. &lt;/P&gt;

&lt;P&gt;Query is :&lt;BR /&gt;
index=abc | table line1 line2 EmailID subject&lt;BR /&gt;
|eval freetext="line1=".line1.";""Line2=".Line2&lt;BR /&gt;
| map search="&lt;BR /&gt;
|sendemail server=test.server from=&lt;A href="mailto:splunk@test.com"&gt;splunk@test.com&lt;/A&gt; to=$EmailID$  subject=$subject$" message=$freetext$&lt;/P&gt;

&lt;P&gt;This query goes into a loop for all individual rows and send an email to respective/individual EmailIDs having freetext printed as :&lt;/P&gt;

&lt;P&gt;Line=sampledata1;Line2=sampledata2&lt;/P&gt;

&lt;P&gt;However I am expecting to send the data in this format:&lt;/P&gt;

&lt;P&gt;Line=sampledata1&lt;BR /&gt;
Line2=sampledata2&lt;/P&gt;

&lt;P&gt;Any idea? Indeed Line 2 is a URL. &lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 02:35:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110472#M28903</guid>
      <dc:creator>ramanjain1983</dc:creator>
      <dc:date>2015-06-16T02:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a combination of map and sendemail to include spaces in the field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110473#M28904</link>
      <description>&lt;P&gt;sorry guys... I found the solution by my own. To my strange the same solution did not work back in older splunk version and worked fine in 6.2.&lt;/P&gt;

&lt;P&gt;It is just we need to escape the line out using shift+ enter while creating the message string&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2015 02:43:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110473#M28904</guid>
      <dc:creator>ramanjain1983</dc:creator>
      <dc:date>2015-06-16T02:43:44Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a combination of map and sendemail to include spaces in the field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110474#M28905</link>
      <description>&lt;P&gt;Other people wondering about this here - xposting for linking &lt;A href="https://answers.splunk.com/answers/213340/how-to-get-splunk-sendemail-command-to-send-multip.html"&gt;https://answers.splunk.com/answers/213340/how-to-get-splunk-sendemail-command-to-send-multip.html&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 18:15:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110474#M28905</guid>
      <dc:creator>mcronkrite</dc:creator>
      <dc:date>2015-12-22T18:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a combination of map and sendemail to include spaces in the field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110475#M28906</link>
      <description>&lt;P&gt;this is the right approach - thx&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 18:15:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110475#M28906</guid>
      <dc:creator>mcronkrite</dc:creator>
      <dc:date>2015-12-22T18:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a combination of map and sendemail to include spaces in the field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110476#M28907</link>
      <description>&lt;P&gt;Also look at &lt;A href="https://answers.splunk.com/answers/27658/map-command-breaks-when-scheduled.html"&gt;https://answers.splunk.com/answers/27658/map-command-breaks-when-scheduled.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2015 18:39:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110476#M28907</guid>
      <dc:creator>mcronkrite</dc:creator>
      <dc:date>2015-12-22T18:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: How can I use a combination of map and sendemail to include spaces in the field values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110477#M28908</link>
      <description>&lt;P&gt;this is not working for me.&lt;/P&gt;

&lt;P&gt;2020-04-26 16:43:42,996 +0400 WARNING   sendemail:1505 - search results is empty, no email will be sent&lt;/P&gt;</description>
      <pubDate>Sun, 26 Apr 2020 12:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-use-a-combination-of-map-and-sendemail-to-include/m-p/110477#M28908</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-04-26T12:46:37Z</dc:date>
    </item>
  </channel>
</rss>

