<?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 I escape the ' in Splunk search while running from command line? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-escape-the-in-Splunk-search-while-running-from-command/m-p/320782#M164572</link>
    <description>&lt;P&gt;The single quote is being interpreted by curl as the breaker for your opening single quote for the &lt;CODE&gt;search&lt;/CODE&gt;. Try escaping the single quote in &lt;CODE&gt;user's&lt;/CODE&gt; with a backslash wrapped in single quotes. So it will look like this: &lt;CODE&gt;user'\''s&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If you cut and paste the search above, you're also missing a closing set of double quotes, btw.  I expect  your total command should look like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;curl -ku "user:password" &lt;A href="https://myserver.com:8089/services/search/jobs/export" target="test_blank"&gt;https://myserver.com:8089/services/search/jobs/export&lt;/A&gt; --data-urlencode search='search index=logs1 daysago=1 "user'\''s password changed"' -o splunkDataForLast24Hour.csv&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Dec 2017 21:05:43 GMT</pubDate>
    <dc:creator>elliotproebstel</dc:creator>
    <dc:date>2017-12-05T21:05:43Z</dc:date>
    <item>
      <title>How do I escape the ' in Splunk search while running from command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-escape-the-in-Splunk-search-while-running-from-command/m-p/320781#M164571</link>
      <description>&lt;P&gt;Here is my query...&lt;/P&gt;

&lt;P&gt;curl -ku "user:password"  &lt;A href="https://myserver.com:8089/services/search/jobs/export"&gt;https://myserver.com:8089/services/search/jobs/export&lt;/A&gt;      --data-urlencode search='search index=logs1  daysago=1 "user's password changed' -o splunkDataForLast24Hour.csv&lt;/P&gt;

&lt;P&gt;Above query fails because of single quote in "user's" string, the query will work if I take out that quote but I want it to be there to find out the exact phrase.&lt;/P&gt;

&lt;P&gt;Even placing backslash did not help. Any inputs?&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 19:58:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-escape-the-in-Splunk-search-while-running-from-command/m-p/320781#M164571</guid>
      <dc:creator>chetanhonnavile</dc:creator>
      <dc:date>2017-12-05T19:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I escape the ' in Splunk search while running from command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-escape-the-in-Splunk-search-while-running-from-command/m-p/320782#M164572</link>
      <description>&lt;P&gt;The single quote is being interpreted by curl as the breaker for your opening single quote for the &lt;CODE&gt;search&lt;/CODE&gt;. Try escaping the single quote in &lt;CODE&gt;user's&lt;/CODE&gt; with a backslash wrapped in single quotes. So it will look like this: &lt;CODE&gt;user'\''s&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;If you cut and paste the search above, you're also missing a closing set of double quotes, btw.  I expect  your total command should look like this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;curl -ku "user:password" &lt;A href="https://myserver.com:8089/services/search/jobs/export" target="test_blank"&gt;https://myserver.com:8089/services/search/jobs/export&lt;/A&gt; --data-urlencode search='search index=logs1 daysago=1 "user'\''s password changed"' -o splunkDataForLast24Hour.csv&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 21:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-escape-the-in-Splunk-search-while-running-from-command/m-p/320782#M164572</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-12-05T21:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do I escape the ' in Splunk search while running from command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-escape-the-in-Splunk-search-while-running-from-command/m-p/320783#M164573</link>
      <description>&lt;P&gt;BTW, according to this post (&lt;A href="https://stackoverflow.com/questions/32122586/curl-escape-single-quote"&gt;https://stackoverflow.com/questions/32122586/curl-escape-single-quote&lt;/A&gt;) you might also have success if you change your single quotes around the &lt;CODE&gt;search&lt;/CODE&gt; value to double-quotes and escape the double-quotes within the search using regular backlashes.&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 21:07:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-escape-the-in-Splunk-search-while-running-from-command/m-p/320783#M164573</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2017-12-05T21:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I escape the ' in Splunk search while running from command line?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-escape-the-in-Splunk-search-while-running-from-command/m-p/320784#M164574</link>
      <description>&lt;P&gt;Just look for “password changed” instead...&lt;/P&gt;</description>
      <pubDate>Tue, 05 Dec 2017 23:34:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-escape-the-in-Splunk-search-while-running-from-command/m-p/320784#M164574</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2017-12-05T23:34:46Z</dc:date>
    </item>
  </channel>
</rss>

