<?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 search for an alert via rest with a name that contains spaces? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210985#M61699</link>
    <description>&lt;P&gt;Thanks for the update. I am going to run this by some of my colleagues--it's possible you might need to contact Support to get more specific troubleshooting help. I'll report back shortly.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Apr 2016 20:37:30 GMT</pubDate>
    <dc:creator>frobinson_splun</dc:creator>
    <dc:date>2016-04-20T20:37:30Z</dc:date>
    <item>
      <title>How to search for an alert via rest with a name that contains spaces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210981#M61695</link>
      <description>&lt;P&gt;I have an alert named e.g. "My Alert".  How do I search for it in Splunk using the REST API?&lt;/P&gt;

&lt;P&gt;I can successfully search all alerts with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/alerts/fired_alerts/ 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But I cannot figure out how to search by name when the alert has spaces in it (all of our configured alerts have spaces, so I actually don't have one without spaces to test out separately).  I've tried:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest /services/alerts/fired_alerts/My Alert/
| rest /services/alerts/fired_alerts/My%20Alert/
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and neither works.  They both fail with a "Failed to fetch REST endpoint" error message.  &lt;/P&gt;

&lt;P&gt;Any tips?&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 17:14:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210981#M61695</guid>
      <dc:creator>danielpops</dc:creator>
      <dc:date>2016-04-20T17:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an alert via rest with a name that contains spaces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210982#M61696</link>
      <description>&lt;P&gt;Hi @danielpops,&lt;BR /&gt;
Have you tried an underscore character where the spaces occur?&lt;/P&gt;

&lt;P&gt;Also, when you GET all fired alerts from the /alerts/fired_alerts endpoint, how does the name of your alert appear in the response? I'm not sure if you can use the same syntax to get the specific alert. &lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 18:32:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210982#M61696</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-04-20T18:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an alert via rest with a name that contains spaces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210983#M61697</link>
      <description>&lt;P&gt;Underscores doesn't seem to change the behavior.  I still get&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;22 errors occurred while the search was executing. Therefore, search results might be incomplete. Hide errors.
Failed to fetch REST endpoint uri=https://127.0.0.1:8089/services/alerts/fired_alerts/My_Alert?count=0 from server=https://127.0.0.1:8089
The limit has been reached for log messages in info.csv. 40 messages have not been written to info.csv. Please refer to search.log for these messages or limits.conf to configure this limit.
[ip-xx-xx-xx-xx] Failed to fetch REST endpoint uri=https://127.0.0.1:8089/services/alerts/fired_alerts/My_Alert?count=0 from server=https://127.0.0.1:8089
[...]
0 events (3/21/16 12:00:00.000 AM to 4/20/16 8:09:27.000 PM)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I don't see my specific alerts in the &lt;CODE&gt;GET all&lt;/CODE&gt; case, though I do see results on the alerts tab for that particular alert.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 20:13:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210983#M61697</guid>
      <dc:creator>danielpops</dc:creator>
      <dc:date>2016-04-20T20:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an alert via rest with a name that contains spaces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210984#M61698</link>
      <description>&lt;P&gt;Hi danielpops,&lt;/P&gt;

&lt;P&gt;Running on Splunk 6.4.0 this works for me:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest splunk_server=master /servicesNS/-/-/alerts/fired_alerts/My%20Test
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the &lt;CODE&gt;splunk_server&lt;/CODE&gt; is just added because this is my little DEV cluster environment running on my laptop. The result looks like this:&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/1256i07D87DCEEC923F7C/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;BR /&gt;
I'm using &lt;CODE&gt;servicesNS/-/-/&lt;/CODE&gt; instead of &lt;CODE&gt;services&lt;/CODE&gt; because I want to get all alerts from all users in all apps. But &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| rest splunk_server=master /services/alerts/fired_alerts/My%20Test
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;works as well and returns the same result for me.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 20:36:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210984#M61698</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-04-20T20:36:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an alert via rest with a name that contains spaces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210985#M61699</link>
      <description>&lt;P&gt;Thanks for the update. I am going to run this by some of my colleagues--it's possible you might need to contact Support to get more specific troubleshooting help. I'll report back shortly.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 20:37:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210985#M61699</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-04-20T20:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to search for an alert via rest with a name that contains spaces?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210986#M61700</link>
      <description>&lt;P&gt;Hi again, @danielpops,&lt;BR /&gt;
I've checked in with my colleagues. As @MuS mentions below, the correct way to indicate the space in an alert name is using %20, as in &lt;BR /&gt;
 | rest /services/alerts/fired_alerts/My%20Alert/&lt;/P&gt;

&lt;P&gt;Given the error messages you are seeing, I'm not sure that they are related to using the endpoint. I would suggest that you contact Support to get more specific help:&lt;BR /&gt;
&lt;A href="http://www.splunk.com/en_us/about-us/contact.html#tabs/customer-support"&gt;http://www.splunk.com/en_us/about-us/contact.html#tabs/customer-support&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/en_us/support-and-services.html"&gt;http://www.splunk.com/en_us/support-and-services.html&lt;/A&gt; (See "Contact Support" at bottom of this page)&lt;/P&gt;</description>
      <pubDate>Wed, 20 Apr 2016 21:24:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-for-an-alert-via-rest-with-a-name-that-contains/m-p/210986#M61700</guid>
      <dc:creator>frobinson_splun</dc:creator>
      <dc:date>2016-04-20T21:24:09Z</dc:date>
    </item>
  </channel>
</rss>

