<?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 do you escape backslashes in user input and then use that user input in a post process search? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142098#M8561</link>
    <description>&lt;P&gt;That doesn't seem well documented, but form what I can tell it escapes quotes.  Is it supposed to escape the backslash character?  In any case it's not working, no results are returned.&lt;/P&gt;</description>
    <pubDate>Fri, 26 Sep 2014 22:48:06 GMT</pubDate>
    <dc:creator>norskedm</dc:creator>
    <dc:date>2014-09-26T22:48:06Z</dc:date>
    <item>
      <title>How do you escape backslashes in user input and then use that user input in a post process search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142096#M8559</link>
      <description>&lt;P&gt;I have a simple xml form, and one input is used to allow the user to filter search results.&lt;/P&gt;

&lt;P&gt;The field used to filter is full of windows file paths that use backslashes.&lt;/P&gt;

&lt;P&gt;I don't want my users to escape their backslashes in their text input.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval t_dfs_path = replace("$t_dfs_path$", "\\\\", "\\\\") | eval t_dfs_path = "*".t_dfs_path."*" | search dfs_path = t_dfs_path
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Sep 2014 02:36:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142096#M8559</guid>
      <dc:creator>norskedm</dc:creator>
      <dc:date>2014-09-26T02:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do you escape backslashes in user input and then use that user input in a post process search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142097#M8560</link>
      <description>&lt;P&gt;Use the |s filter for tokens to escape them for use in search strings:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;searchString&amp;gt;filepath=$filepath|s$&amp;lt;/searchString&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Sep 2014 18:45:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142097#M8560</guid>
      <dc:creator>dfoster_splunk</dc:creator>
      <dc:date>2014-09-26T18:45:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do you escape backslashes in user input and then use that user input in a post process search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142098#M8561</link>
      <description>&lt;P&gt;That doesn't seem well documented, but form what I can tell it escapes quotes.  Is it supposed to escape the backslash character?  In any case it's not working, no results are returned.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Sep 2014 22:48:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142098#M8561</guid>
      <dc:creator>norskedm</dc:creator>
      <dc:date>2014-09-26T22:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do you escape backslashes in user input and then use that user input in a post process search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142099#M8562</link>
      <description>&lt;P&gt;Hmm. Works for me. I generated data by running the search 'index=_internal | head 2 | eval file="foo.txt" | eval path="C:\Windows\" | outputcsv output.csv'. Then I created a dashboard with a form input bound to $path$ and a table powered by the search '| inputcsv output.csv | search path=$path|s$'. If I type 'C:\Windows\' in the text field and press enter. I get the result I was expecting. Tested on Splunk 6.1.3.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2014 18:17:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142099#M8562</guid>
      <dc:creator>dfoster_splunk</dc:creator>
      <dc:date>2014-09-29T18:17:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do you escape backslashes in user input and then use that user input in a post process search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142100#M8563</link>
      <description>&lt;P&gt;Blast. This site is deleting backslashes in my response. See the unadulterated form here: &lt;A href="https://gist.github.com/davidfstr/79477ece71c8056d745d"&gt;https://gist.github.com/davidfstr/79477ece71c8056d745d&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Sep 2014 18:19:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142100#M8563</guid>
      <dc:creator>dfoster_splunk</dc:creator>
      <dc:date>2014-09-29T18:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do you escape backslashes in user input and then use that user input in a post process search?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142101#M8564</link>
      <description>&lt;P&gt;@dfoster_splunk this worked great! Thank you! &lt;BR /&gt;
I had tried everything else I could think of to escape so users could input searches into a dashboard input that outputs to a lookuptable. This fixed it. I wonder if the issue norskedm was having was if you try to add it to the search, but not through the XML, it didn't seem to work. &lt;/P&gt;</description>
      <pubDate>Thu, 28 Mar 2019 16:37:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-escape-backslashes-in-user-input-and-then-use-that/m-p/142101#M8564</guid>
      <dc:creator>jbillings</dc:creator>
      <dc:date>2019-03-28T16:37:50Z</dc:date>
    </item>
  </channel>
</rss>

