<?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 replace \ with \\ in eval statement in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/how-to-replace-with-in-eval-statement/m-p/465076#M131043</link>
    <description>&lt;P&gt;This may help:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/84781/replace-one-backslash-by-double-backslash.html"&gt;https://answers.splunk.com/answers/84781/replace-one-backslash-by-double-backslash.html&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 28 Aug 2019 09:07:29 GMT</pubDate>
    <dc:creator>p_gurav</dc:creator>
    <dc:date>2019-08-28T09:07:29Z</dc:date>
    <item>
      <title>how to replace \ with \\ in eval statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-replace-with-in-eval-statement/m-p/465075#M131042</link>
      <description>&lt;P&gt;i expect  var1="d:\test\data.csv" but i got &lt;/P&gt;

&lt;P&gt;it shows mismatch or missing closing parenthesis&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;var="d:\test\data.csv"&lt;BR /&gt;
|eval var1=replace(var,"\","\\")&lt;BR /&gt;
&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 09:02:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-replace-with-in-eval-statement/m-p/465075#M131042</guid>
      <dc:creator>reney44</dc:creator>
      <dc:date>2019-08-28T09:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace \ with \\ in eval statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-replace-with-in-eval-statement/m-p/465076#M131043</link>
      <description>&lt;P&gt;This may help:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://answers.splunk.com/answers/84781/replace-one-backslash-by-double-backslash.html"&gt;https://answers.splunk.com/answers/84781/replace-one-backslash-by-double-backslash.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 09:07:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-replace-with-in-eval-statement/m-p/465076#M131043</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2019-08-28T09:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: how to replace \ with \\ in eval statement</title>
      <link>https://community.splunk.com/t5/Splunk-Search/how-to-replace-with-in-eval-statement/m-p/465077#M131044</link>
      <description>&lt;P&gt;If all you are trying to do is to replace one backslash with two then you can do the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count
| eval var="d:\\test\\data.csv"
| eval var1=replace(var,"\\\\","\\\\\\")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(Ignore the stats count as I used this to test)&lt;BR /&gt;
Output:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/7587i7B07E1FC3DAF3A5F/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Take a look at the following links if you want to read more about it:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/SPLandregularexpressions#Backslash_characters"&gt;https://docs.splunk.com/Documentation/Splunk/latest/Search/SPLandregularexpressions#Backslash_characters&lt;/A&gt;&lt;BR /&gt;
&lt;A href="https://answers.splunk.com/answers/623193/tricky-behavior-of-escaping-backslash-in-regex.html#answer-624381"&gt;https://answers.splunk.com/answers/623193/tricky-behavior-of-escaping-backslash-in-regex.html#answer-624381&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Regards,&lt;BR /&gt;
J&lt;/P&gt;</description>
      <pubDate>Wed, 28 Aug 2019 09:13:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/how-to-replace-with-in-eval-statement/m-p/465077#M131044</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2019-08-28T09:13:20Z</dc:date>
    </item>
  </channel>
</rss>

