Thanks Jochen,

I used Wireshark to see that it was passing  "Expect100Continue" in the 
header and Graylog did not like that. so I set the following:

 httpWebRequest.KeepAlive = false;

            httpWebRequest.ServicePoint.Expect100Continue = false;


On Thursday, February 25, 2016 at 8:45:04 AM UTC-7, Jochen Schalanda wrote:
>
> Hi Gary,
>
> could you please use something like TCPDump or Wireshark to check how the 
> HTTP request looks like, that your client sends to Graylog's GELF HTTP 
> input?
>
> Judging from the error message, it seems like the HTTP request body was 
> missing.
>
> Cheers,
> Jochen
>
> On Thursday, 25 February 2016 00:23:37 UTC+1, [email protected] wrote:
>>
>> Does anyone know why this Windows Client side HTTP Gelf input would give 
>> me the following error in the Graylog log?
>>
>> java.lang.IllegalStateException: GELF message is too short. Not even the 
>> type header would fit.
>>
>>
>>
>>  static void Main(string[] args)
>>  {
>>      string url = "http://99.99.99.99:12201/gelf";;
>>      var httpWebRequest = (HttpWebRequest)WebRequest.Create(url);
>>       httpWebRequest.ContentType = "text/json";
>>       httpWebRequest.Method = "POST";
>>       using (var streamWriter = new StreamWriter(httpWebRequest.
>> GetRequestStream()))
>>
>>
>>              {
>>                  string json = "{\"version\":\"1.1\"," +
>>                                "\"host\":\"MyHost\"," +
>>                                "\"short_message\":\"A short message that 
>> helps you identify what is going on\"," +
>>                                "\"facility\":\"test\"," +
>>                                 "\"_foo\":\"bar\" }";
>>
>>
>>                  streamWriter.Write(json);
>>                  streamWriter.Flush();
>>                  streamWriter.Close();
>>              }
>>       var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
>>
>>
>>
>>
>>
>> Thanks! Gary
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Graylog Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/graylog2/484b6184-8b68-4d0a-a707-b6377c264cbb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to