<p dir="ltr">Thanks for the reply.  Going to script something for now, but will keep an eye out for updates </p>
<div class="gmail_extra"><br><div class="gmail_quote">On Nov 8, 2016 5:29 PM, "Japheth Cleaver" <<a href="mailto:cleaver@terabithia.org">cleaver@terabithia.org</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="elided-text">On 11/8/2016 10:01 AM, Patrick Nixon wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hey all,<br>
 I'm attempted to pass two headers along with the http request.   I found httphdr which appears to be what I want to use.<br>
<br>
This is the hosts entry as it stands now.<br>
(two lines<br>
0.0.0.0 apiserver # noconn auto <a href="https://apiserver/api/status" rel="noreferrer" target="_blank">https://apiserver/api/status</a> httphdr="X-app-key: 00000000000<br>
X-app-id: 1111111"<br>
<br>
I also tried<br>
0.0.0.0 apiserver # noconn auto <a href="https://apiserver/api/status" rel="noreferrer" target="_blank">https://apiserver/api/status</a> httphdr="X-app-key: 00000000000, X-app-id: 1111111"<br>
<br>
When I run this from the command line it works as expected<br>
curl -H "X-app-id: 1111111" -H "X-app-key: 0000000000" <a href="https://apiserver/api/status" rel="noreferrer" target="_blank">https://apiserver/api/status</a><br>
<br>
Suggestions on what to tweak to make this funcitonal?<br>
</blockquote>
<br></div>
Unfortunately, the current syntax doesn't really allow for it multiple headers properly. This is something that should probably be added, though. The string is naively inserted into the HTTP payload followed by a \r\n, but otherwise is unchanged.<br>
<br>
<br>
The problem with the first syntax is two-fold: hosts.cfg is processed first getting rid of escaped newlines, so when config options are passed in they're expected to be on a single line. The parser is looking for the end of the quote and/or the new line itself and stops there, so you only get the first part. Modifying that to incorporate the literal, alas, would give you "X-app-key: 00000000000\nX-app-id: 1111111" (assuming you're on a *nix system), but that's incorrect for headers.<br>
<br>
Allowing for multiple httphdr="" would be the cleanest syntax, but I'm not actually certain if we ever parse anything like that as it stands now, so it may take a little bit of work. Allowing for escaped values in quoted strings is another option. It's less clean for this value (httphdr="Something\r\nSomethi<wbr>ngElse" - yuck) but could have other value. It also could cause problems with other options, though, like regex's which pass through to further processing. It also means re-escaping when doing hosts.cfg file transfers and queries.<br>
<br>
A short term hack would be to special case "\r\n" in this field alone and substitute the real thing at the moment when we inject the headers, but that's... also kind of ugly.<br>
<br>
<br>
Regards,<br>
-jc<br>
______________________________<wbr>_________________<br>
Xymon mailing list<br>
<a href="mailto:Xymon@xymon.com" target="_blank">Xymon@xymon.com</a><br>
<a href="http://lists.xymon.com/mailman/listinfo/xymon" rel="noreferrer" target="_blank">http://lists.xymon.com/mailman<wbr>/listinfo/xymon</a><br>
</blockquote></div><br></div>