<?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: Import Health Rule error message - Unexpected character (- (code 45)) in numeric value in Splunk AppDynamics</title>
    <link>https://community.splunk.com/t5/Splunk-AppDynamics/Import-Health-Rule-error-message-Unexpected-character-code-45-in/m-p/735548#M9440</link>
    <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;Can you share your health rule json file you are trying to import?&lt;/P&gt;&lt;P&gt;Did you build it from scratch, or did you export it, and you are trying to import it again?&lt;/P&gt;&lt;P&gt;The query you should be using is as follows&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Need to use --data, not -F File&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;curl -X POST --user user@user:password "https://&amp;lt;controller details/controller/alerting/rest/v1/applications/&amp;lt;application ID&amp;gt;/health-rules" -H "Content-Type: application/json" --data "@test2.json"&lt;/P&gt;</description>
    <pubDate>Thu, 16 Jul 2020 10:32:49 GMT</pubDate>
    <dc:creator>Morelz</dc:creator>
    <dc:date>2020-07-16T10:32:49Z</dc:date>
    <item>
      <title>Import Health Rule error message - Unexpected character (- (code 45)) in numeric value</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Import-Health-Rule-error-message-Unexpected-character-code-45-in/m-p/735547#M9439</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;Has anyone faced the following problem when importing a health rule in JSON format?&lt;/P&gt;&lt;P&gt;I'm using the following curl command:&lt;/P&gt;&lt;PRE class="lia-code-sample language-markup"&gt;&lt;CODE&gt;curl -sL -w "%{http_code}" -X POST --user "${USER}:${PASS}" \
-H "Content-Type: application/json" -F file=@${FILE}.json \
https://$HOST/controller/alerting/rest/v1/applications/$APP_ID/health-rules&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;which in every JSON file I tried, returns me this error:&lt;/P&gt;&lt;PRE class="lia-code-sample language-markup"&gt;&lt;CODE&gt;{
"statusCode" : 400,
"message" : "Unexpected character (- (code 45)) in numeric value: expected digit (0-9) to follow minus sign, for valid numeric value "
}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;... even if I'm using the same JSON as in the official documentation:&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.appdynamics.com/display/PRO45/Health+Rule+API" target="_self" rel="nofollow noopener noreferrer"&gt;https://docs.appdynamics.com/display/PRO45/Health+Rule+API&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The JSON files I've tried do not contain any hyphen characters, so apparently the request payload is not related to the error cause.&lt;/P&gt;&lt;P&gt;Anyone been there?&lt;/P&gt;&lt;P&gt;Thanks and regards.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 15:40:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Import-Health-Rule-error-message-Unexpected-character-code-45-in/m-p/735547#M9439</guid>
      <dc:creator>Mikel_Osinalde_</dc:creator>
      <dc:date>2020-07-15T15:40:19Z</dc:date>
    </item>
    <item>
      <title>Re: Import Health Rule error message - Unexpected character (- (code 45)) in numeric value</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Import-Health-Rule-error-message-Unexpected-character-code-45-in/m-p/735548#M9440</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;Can you share your health rule json file you are trying to import?&lt;/P&gt;&lt;P&gt;Did you build it from scratch, or did you export it, and you are trying to import it again?&lt;/P&gt;&lt;P&gt;The query you should be using is as follows&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Need to use --data, not -F File&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;curl -X POST --user user@user:password "https://&amp;lt;controller details/controller/alerting/rest/v1/applications/&amp;lt;application ID&amp;gt;/health-rules" -H "Content-Type: application/json" --data "@test2.json"&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 10:32:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Import-Health-Rule-error-message-Unexpected-character-code-45-in/m-p/735548#M9440</guid>
      <dc:creator>Morelz</dc:creator>
      <dc:date>2020-07-16T10:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Import Health Rule error message - Unexpected character (- (code 45)) in numeric value</title>
      <link>https://community.splunk.com/t5/Splunk-AppDynamics/Import-Health-Rule-error-message-Unexpected-character-code-45-in/m-p/735549#M9441</link>
      <description>&lt;P&gt;Good morning Mario,&lt;/P&gt;&lt;P&gt;Thanks for your tip, once I changed to --data instead of -F file, it worked!!!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 09:38:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-AppDynamics/Import-Health-Rule-error-message-Unexpected-character-code-45-in/m-p/735549#M9441</guid>
      <dc:creator>Mikel_Osinalde_</dc:creator>
      <dc:date>2020-07-17T09:38:06Z</dc:date>
    </item>
  </channel>
</rss>

