{"action":"created","issue":{"url":"https://api.github.com/repos/influxdata/telegraf/issues/3001","repository_url":"https://api.github.com/repos/influxdata/telegraf","labels_url":"https://api.github.com/repos/influxdata/telegraf/issues/3001/labels{/name}","comments_url":"https://api.github.com/repos/influxdata/telegraf/issues/3001/comments","events_url":"https://api.github.com/repos/influxdata/telegraf/issues/3001/events","html_url":"https://github.com/influxdata/telegraf/issues/3001","id":241846576,"number":3001,"title":"service crash with panic: slice bounds out of range ","user":{"login":"mattwwarren","id":1245662,"avatar_url":"https://avatars2.githubusercontent.com/u/1245662?v=3","gravatar_id":"","url":"https://api.github.com/users/mattwwarren","html_url":"https://github.com/mattwwarren","followers_url":"https://api.github.com/users/mattwwarren/followers","following_url":"https://api.github.com/users/mattwwarren/following{/other_user}","gists_url":"https://api.github.com/users/mattwwarren/gists{/gist_id}","starred_url":"https://api.github.com/users/mattwwarren/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattwwarren/subscriptions","organizations_url":"https://api.github.com/users/mattwwarren/orgs","repos_url":"https://api.github.com/users/mattwwarren/repos","events_url":"https://api.github.com/users/mattwwarren/events{/privacy}","received_events_url":"https://api.github.com/users/mattwwarren/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-07-10T20:58:14Z","updated_at":"2017-07-10T21:15:59Z","closed_at":null,"body":"## Bug report\r\n\r\n### Relevant telegraf.conf:\r\nApologies if not all of this is relevant.\r\n\r\n```\r\n[global_tags]\r\n  env = \"prod\"\r\n\r\n[agent]\r\n  interval = \"10s\"\r\n  round_interval = false\r\n  metric_batch_size = 2000\r\n  metric_buffer_limit = 6000\r\n  collection_jitter = \"0s\"\r\n  flush_interval = \"10s\"\r\n  flush_jitter = \"3s\"\r\n  precision = \"\"\r\n  debug = false\r\n  quiet = false\r\n  hostname = \"\"\r\n  omit_hostname = false\r\n\r\n[[outputs.influxdb]]\r\n  urls = [\r\n            \"http://myinflux:8086\",\r\n              ]\r\n  database = \"api\"\r\n  retention_policy = \"\"\r\n    namedrop = [\"ops_*\", \"logparser*\"]\r\n    write_consistency = \"any\"\r\n  timeout = \"5s\"\r\n\r\n[[outputs.influxdb]]\r\n  urls = [\r\n            \"http://myinflux:8086\",\r\n              ]\r\n  database = \"telegraf_prod\"\r\n  retention_policy = \"telegraf_prod_default\"\r\n  namepass = [\"ops_*\", \"logparser*\"]\r\n  write_consistency = \"any\"\r\n  timeout = \"5s\"\r\n\r\n[[inputs.logparser]]\r\n  files = [\r\n    \"/var/log/httpd/*access.log\",\r\n    \"/var/log/httpd/*combined.log\",\r\n    \"/var/log/httpd/*forwarded.log\",\r\n  ]\r\n\r\n  [inputs.logparser.grok]\r\n  patterns = [\r\n    \"%{COMBINED_LOG_FORMAT_WITH_RESPONSE_TIME_US}\"\r\n  ]\r\n\r\n### service input plugins ###\r\n  custom_patterns = '''\r\n  COMBINED_LOG_FORMAT_WITH_RESPONSE_TIME_US %{CLIENT:client_ip} %{NOTSPACE:ident} %{NOTSPACE:auth} \\[%{HTTPDATE:ts:ts-httpd}\\] \"(?:%{WORD:verb:tag} %{NOTSPACE:request}(?: HTTP/%{NUMBER:http_version:float})?|%{DATA})\" %{NUMBER:resp_code:int} (?:%{NUMBER:resp_bytes:int}|-) %{QS:referrer} %{QS:agent} %{NUMBER:response_time_us:int}\r\n  '''\r\n```\r\n\r\n### System info:\r\n\r\nTelegraf v1.3.3 (git: release-1.3 46db92aad3e68af04f1732598ac89f6b9b11daf8)\r\nAmazon Linux latest\r\n\r\n\r\n### Steps to reproduce:\r\n\r\n1. Set up a high volume application with apache logs running through telegraf\r\n2. Wait?\r\n\r\n### Expected behavior:\r\nTelegraf does not crash\r\n\r\n### Actual behavior:\r\nAfter running for some number of hours, telegraf will crash with `panic: runtime error: slice bounds out of range`\r\n\r\n### Additional info:\r\n\r\n```\r\ngoroutine 30 [running]:\r\ngithub.com/influxdata/telegraf/metric.(*metric).Fields(0xc420789800, 0xc420e36fe0)\r\n        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/metric/metric.go:318 +0x5c8\r\ngithub.com/influxdata/telegraf/plugins/inputs/logparser.(*LogParserPlugin).parser(0xc420328000)\r\n        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/logparser/logparser.go:224 +0x25f\r\ncreated by github.com/influxdata/telegraf/plugins/inputs/logparser.(*LogParserPlugin).Start\r\n        /home/ubuntu/telegraf-build/src/github.com/influxdata/telegraf/plugins/inputs/logparser/logparser.go:129 +0x56d\r\n```\r\n\r\nI glanced over the code but couldn't quite tell where the error bottomed out. I thought perhaps our custom log pattern was at the source of the issue but the only float field is the HTTP version and they are all 1.1\r\n\r\n```\r\n# cat /var/log/httpd/api.access.log | awk -F'HTTP/' '{print $2}' | awk -F'\"' '{print $1}' | sort | uniq -c\r\n 954368 1.1\r\n```"},"comment":{"url":"https://api.github.com/repos/influxdata/telegraf/issues/comments/314247382","html_url":"https://github.com/influxdata/telegraf/issues/3001#issuecomment-314247382","issue_url":"https://api.github.com/repos/influxdata/telegraf/issues/3001","id":314247382,"user":{"login":"danielnelson","id":1048079,"avatar_url":"https://avatars0.githubusercontent.com/u/1048079?v=3","gravatar_id":"","url":"https://api.github.com/users/danielnelson","html_url":"https://github.com/danielnelson","followers_url":"https://api.github.com/users/danielnelson/followers","following_url":"https://api.github.com/users/danielnelson/following{/other_user}","gists_url":"https://api.github.com/users/danielnelson/gists{/gist_id}","starred_url":"https://api.github.com/users/danielnelson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielnelson/subscriptions","organizations_url":"https://api.github.com/users/danielnelson/orgs","repos_url":"https://api.github.com/users/danielnelson/repos","events_url":"https://api.github.com/users/danielnelson/events{/privacy}","received_events_url":"https://api.github.com/users/danielnelson/received_events","type":"User","site_admin":false},"created_at":"2017-07-10T21:15:59Z","updated_at":"2017-07-10T21:15:59Z","body":"Can you check if it panics again if you replay the same logs?  You will probably need to use `from_beginning = true`."}}
{"actor":{"display_login":"danielnelson"}}