Skip to content

How do I add the new conditionals in the Chef config? #4

@iandexter

Description

@iandexter

How do I use the new conditional for "type" in the Chef configuration?

I currently use the following config:

...
    "agent": {
      "inputs": [
        {
          "file": {
            "path": ["/var/log/nginx/*log"],
            "exclude": ["*.gz"],
            "type": "nginx-access",
            "start_position": "beginning"
          }
        }
      ],
      "filters": [
        {
          "grok": {
            "type": "nginx-access",
            "match": [ "message", "%{IPORHOST:remote_addr} - %{USER:remote_user} \\[%{HTTPDATE:timestamp}\\] \\\"(?:%{WORD:http_verb} %{NOTSPACE:http_request}(?: HTTP/%{NUMBER:http_version})?|%{DATA:raw_http_request})\\\" %{NUMBER:http_status_code} (?:%{NUMBER:bytes_read}|-) %{QS:http_referer} %{QS:http_user_agent}"]
          }
        }
      ],
...

It appears to work, but I'm getting this in the logs:

{:timestamp=>"2014-12-28T13:10:20.495000+0000", :message=>"You are using a deprecated config setting \"type\" set in grok. Deprecated settings will continue to work, but are scheduled for removal from logstash in the future. You can achieve this same behavior with the new conditionals, like: `if [type] == \"sometype\" { grok { ... } }`. If you have any questions about this, please visit the #logstash channel on freenode irc.", :name=>"type", :plugin=><LogStash::Filters::Grok --->, :level=>:warn}

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions