Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GELF4Net code "timestamp" from string to float format? #51

Closed
sphinxsys opened this issue Sep 18, 2017 · 6 comments
Closed

GELF4Net code "timestamp" from string to float format? #51

sphinxsys opened this issue Sep 18, 2017 · 6 comments

Comments

@sphinxsys
Copy link

After I updated GrayLog to v2.3, I got the warning in my Graylog which it has invalid "timestamp".

After a little search, I found a similar issue here "Graylog2/graylog2-server#4027".

So I want to know if you convert "timestamp" from string to float before sending to Graylog server?

@jjchiw
Copy link
Owner

jjchiw commented Sep 18, 2017

Hi

We are sending the timestamp as string https://github.com/jjchiw/gelf4net/blob/master/src/Gelf4net/GelfMessage.cs#L84

I'll add a new configuration variable to change the behavior of the timestamp type sent to graylog.....

@sphinxsys
Copy link
Author

Thank you very much

@jjchiw
Copy link
Owner

jjchiw commented Sep 18, 2017

yay!! I think it's done :)

You've to add <param name="SendTimeStampAsString" value="false"/> in the layout, and It'll send the timestamp as a number

 <layout type="Gelf4Net.Layout.GelfLayout, Gelf4Net">
    <param name="AdditionalFields" value="app:UdpAppenderCC,version:1.0,Environment:Dev,Level:%level" />
    <param name="Facility" value="RandomPhrases" />
    <param name="IncludeLocationInformation" value="true" />
    <param name="SendTimeStampAsString" value="false"/>
    <param name="ConversionPattern" value="[%t] %c{1} - %m" />
</layout>

https://www.nuget.org/packages/Gelf4Net/3.0.0.7
https://www.nuget.org/packages/Gelf4Net.UdpAppender/1.0.0.11
https://www.nuget.org/packages/Gelf4Net.AmqpAppender/1.0.0.11
https://www.nuget.org/packages/Gelf4Net.HttpAppender/1.0.0.11

I tested it with image: graylog2/server:2.1.1-1

I had some problems to run docker with image: graylog/graylog:2.3.1-1 but I think it'll work :)

Let me know if it does......

@sphinxsys
Copy link
Author

So great. I will test it soon. But I found a little glitch on dll version which you released in nuget. It is still "3.0.0.6" rather than "3.0.0.7". However I noticed you increased the version inside the repo. Maybe you released your dlls before you updated your assemblyinfo file.

Anyway, thank you very much for your quick hotfix and release! Cool!

I'll let you know if it works in my case.

@sphinxsys
Copy link
Author

@jjchiw yes, it works!

@jjchiw
Copy link
Owner

jjchiw commented Sep 21, 2017

:)
I'll release a new version with the assembly version fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants