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

Can't parse the LogStash::Timestamp #3

Open
slava-vishnyakov opened this issue Jun 9, 2015 · 3 comments
Open

Can't parse the LogStash::Timestamp #3

slava-vishnyakov opened this issue Jun 9, 2015 · 3 comments

Comments

@slava-vishnyakov
Copy link

NoMethodError: undefined method `gsub!' for "2015-06-09T12:50:04.000Z":LogStash::Timestamp
         _parse at /opt/logstash/vendor/jruby/lib/ruby/1.9/date/format.rb:839
          parse at /opt/logstash/vendor/jruby/lib/ruby/1.9/time.rb:265
       to_epoch at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-datadog_metrics-0.1.4/lib/logstash/outputs/datadog_metrics.rb:120
        receive at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-output-datadog_metrics-0.1.4/lib/logstash/outputs/datadog_metrics.rb:75
         handle at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/outputs/base.rb:88
    output_func at (eval):163
   outputworker at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/pipeline.rb:244
  start_outputs at /opt/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.0-java/lib/logstash/pipeline.rb:166

Will provide a code for the error in a few minutes.

@slava-vishnyakov
Copy link
Author

cat > /tmp/filter.txt << EOM
input { stdin {  } }

filter {
  grok {
    match => { "message" => "%{COMBINEDAPACHELOG}" }
  }
  date {
    match => [ "timestamp", "dd/MMM/YYYY:HH:mm:ss Z"]
  }
}


output {
  datadog_metrics {
      api_key => "..."
      metric_name => 'response_time'
      metric_type => "counter"
      metric_value => "1"      
  }
}
EOM

echo '1.2.3.4 - - [09/Jun/2015:15:50:04 +0300] "POST / HTTP/1.1" 499 0 "-" "-" "-"' | /opt/logstash/bin/logstash -e "$(cat /tmp/filter.txt)"

This code triggers the error

@slava-vishnyakov
Copy link
Author

#1 solves it

@devinrsmith
Copy link

+1

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