<?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: REST API job/search returning &amp;quot;text/plain&amp;quot; as a message type? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-REST-API-job-search-returning-quot-text-plain-quot-as-a/m-p/47919#M9063</link>
    <description>&lt;P&gt;Quick update (so I can "answer" this question)&lt;/P&gt;

&lt;P&gt;The integration platform I'm using issued the following bug fix in regards to the "204" response code:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;1-1W397J (IS_7-1-2_SrvPrtcl_Fix3)&lt;BR /&gt;
  The pub.client:http built-in service is not properly handling&lt;BR /&gt;
  response 204 from a client.  &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I've applied the fix, and haven't seen any evidence of this issue in quite some time.  (I also added a special exception for "text/plain", so that it simply logs the issue rather than crashing.)  So I'm assuming this was some weird fluke until I see something suggesting otherwise.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Feb 2011 22:09:31 GMT</pubDate>
    <dc:creator>Lowell</dc:creator>
    <dc:date>2011-02-10T22:09:31Z</dc:date>
    <item>
      <title>Why is REST API job/search returning "text/plain" as a message type?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-REST-API-job-search-returning-quot-text-plain-quot-as-a/m-p/47918#M9062</link>
      <description>&lt;P&gt;Has anyone had any issues with the REST API returning &lt;CODE&gt;text/plain&lt;/CODE&gt; as a message type in a response message?&lt;/P&gt;
&lt;P&gt;I've seen this happen a few times over the last couple of months, and have been assuming that it was a bug in my implementation, but after looking closer it appears that the issue may be coming from a weird response message coming back from splunkd.&lt;/P&gt;
&lt;P&gt;Basically, my process does the following:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Authenticate with splunkd to get an auth token.&lt;/LI&gt;
&lt;LI&gt;Submit a search request.&lt;/LI&gt;
&lt;LI&gt;Query the search job. Wait for the job to be done or finalized, otherwise sleep and poll again.&lt;/LI&gt;
&lt;LI&gt;Fetch the results of the job.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;This error is happening on step 3. The URL is &lt;A href="https://splunk.mydomain.com:8089/services/search/job/" rel="nofollow" target="_blank"&gt;https://splunk.mydomain.com:8089/services/search/job/&lt;/A&gt;&lt;EM&gt;sid&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Here's the actual response message I'm seeing:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;
&amp;lt;response&amp;gt;&amp;lt;messages&amp;gt;&amp;lt;msg type='text/plain'&amp;gt;&amp;lt;/msg&amp;gt;&amp;lt;/messages&amp;gt;&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;My code is expecting that any &lt;CODE&gt;&amp;lt;msg&amp;gt;&lt;/CODE&gt; coming back from splunk to have a &lt;CODE&gt;type&lt;/CODE&gt; of "DEBUG", "INFO", "WARN", or "ERROR" so the &lt;CODE&gt;type&lt;/CODE&gt; of "text/plain" raises an exception.&lt;/P&gt;
&lt;P&gt;I'm still in the process of investigating this on my end, but I was wondering if anyone else had see anything like this. I'm attempting to increase the amount of debug information I'm capturing during a failure, but since this is rather sporadic, it could be a while until it happens again. (It seems a bit early to file a bug since at this point I don't have anything reproducible or specific details about the timing, or even the &lt;CODE&gt;sid&lt;/CODE&gt; of the search job that returned the weird message.)&lt;/P&gt;
&lt;P&gt;Any ideas?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Update:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I've done some more digging on my end, and determined that I seem to be getting a msg type of "text/plain" only when the HTTP response status is &lt;CODE&gt;204&lt;/CODE&gt; (No Content). I was also able to capture a literal XML string returned by the &lt;CODE&gt;splunkd&lt;/CODE&gt; process, so I updated the example above accordingly.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2022 05:36:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-REST-API-job-search-returning-quot-text-plain-quot-as-a/m-p/47918#M9062</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2022-06-10T05:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: REST API job/search returning "text/plain" as a message type?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-REST-API-job-search-returning-quot-text-plain-quot-as-a/m-p/47919#M9063</link>
      <description>&lt;P&gt;Quick update (so I can "answer" this question)&lt;/P&gt;

&lt;P&gt;The integration platform I'm using issued the following bug fix in regards to the "204" response code:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;1-1W397J (IS_7-1-2_SrvPrtcl_Fix3)&lt;BR /&gt;
  The pub.client:http built-in service is not properly handling&lt;BR /&gt;
  response 204 from a client.  &lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I've applied the fix, and haven't seen any evidence of this issue in quite some time.  (I also added a special exception for "text/plain", so that it simply logs the issue rather than crashing.)  So I'm assuming this was some weird fluke until I see something suggesting otherwise.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Feb 2011 22:09:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-REST-API-job-search-returning-quot-text-plain-quot-as-a/m-p/47919#M9063</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2011-02-10T22:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: REST API job/search returning "text/plain" as a message type?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Why-is-REST-API-job-search-returning-quot-text-plain-quot-as-a/m-p/601159#M104758</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Kindly please let me know the fix for this issue&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2022 09:46:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Why-is-REST-API-job-search-returning-quot-text-plain-quot-as-a/m-p/601159#M104758</guid>
      <dc:creator>bhushannbagad</dc:creator>
      <dc:date>2022-06-09T09:46:04Z</dc:date>
    </item>
  </channel>
</rss>

