Giter Site home page Giter Site logo

invalid timestamp format about lograge HOT 16 CLOSED

roidrage avatar roidrage commented on July 24, 2024
invalid timestamp format

from lograge.

Comments (16)

benlovell avatar benlovell commented on July 24, 2024

This is most likely down to how you've configured your custom_options for the @timestamp element. Can you share your configuration?

from lograge.

andywenk avatar andywenk commented on July 24, 2024

@benlovell thanks for the quick reply. Sure, here is the config:

# lograge
config.lograge.enabled = true
config.lograge.custom_options = lambda do | event |
  {:name => Rails.env, :session => event.payload[:session], :host => event.payload[:host]}
end
config.lograge.formatter = Lograge::Formatters::Logstash.new

This is the same for all environments. As you can see, I did not specifically configure the @timestamp attribute. I assumed that Lograge::Formatters::Logstash.new will create the correct format.

from lograge.

benlovell avatar benlovell commented on July 24, 2024

Hmm. Thanks for the info.

It looks to me like this is something going down in https://github.com/elasticsearch/logstash/blob/v1.1.5/lib/logstash/event.rb

We really should bump our logstash-event dependency as it's quite outdated now. I'll investigate this.

from lograge.

andywenk avatar andywenk commented on July 24, 2024

@benlovell thank's a lot! <3

from lograge.

benlovell avatar benlovell commented on July 24, 2024

No problem, thanks for reporting 😍

from lograge.

andywenk avatar andywenk commented on July 24, 2024

@benlovell did you already have a chance to look into this? Thanks for everything ;-)

from lograge.

benlovell avatar benlovell commented on July 24, 2024

@andywenk I didn't yet, but it's definitely on my radar.

from lograge.

andywenk avatar andywenk commented on July 24, 2024

cool - thanks a lot :D

On 15 December 2014 at 15:17, Ben Lovell [email protected] wrote:

@andywenk https://github.com/andywenk I didn't yet, but it's definitely
on my radar.


Reply to this email directly or view it on GitHub
#95 (comment).

Andy Wenk
Hamburg - Germany
RockIt!

http://www.couchdb-buch.de
http://www.pg-praxisbuch.de

GPG fingerprint: C044 8322 9E12 1483 4FEC 9452 B65D 6BE3 9ED3 9588

https://people.apache.org/keys/committer/andywenk.asc

from lograge.

pxlpnk avatar pxlpnk commented on July 24, 2024

It seems this is fixed in the 1.2.x version: https://github.com/elasticsearch/logstash/blob/v1.2.2/lib/logstash/event.rb

I don't see where lograge is enforcing any version of logstash-event except for the tests.

from lograge.

pxlpnk avatar pxlpnk commented on July 24, 2024

@andywenk is the current master 940cba8 working for you?

from lograge.

andywenk avatar andywenk commented on July 24, 2024

it should look like this I think:

https://github.com/elasticsearch/logstash/blob/v1.2.2/lib/logstash/event.rb#L37

But what I have when using master from github is:

{
   ... 
   "@timestamp": "2015/02/08 14:13:39 +0000",
   "@version": "1",
   "message": "[200] GET /warenkorb (carts#show)"
}

The configuration from above is the same. Am I missing something? Am I the only one with this problem?
Thanks a lot for looking into this ;-)

from lograge.

andywenk avatar andywenk commented on July 24, 2024

ok it is a bit clearer now. I created a new application and used the same settings and there it is working:

{
    "@timestamp": "2015-02-08T14:45:26.847Z",
    "@version": "1",
    "message": "[200] GET / (start#index)"
}

I think some other gem is doing bad things so that it does not work correctly. I will investigate this further and let you know. If it matters, you can close this issue.

Thanks for everything!

from lograge.

pxlpnk avatar pxlpnk commented on July 24, 2024

As lograge doesn't do anything about the date format I suggest checking the gems then too.
I am closing this issue for now. But please feel free to report the result of your research in this ticket.

from lograge.

andywenk avatar andywenk commented on July 24, 2024

@pxlpnk the problem is couch_potato which is monkey patching Date globally.

langalex/couch_potato#105

I will close this now ;-)

from lograge.

pxlpnk avatar pxlpnk commented on July 24, 2024

updown

Thank you for investigating this!

from lograge.

andywenk avatar andywenk commented on July 24, 2024

you're welcome ;-)

from lograge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.