Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

logstash-config: how to configure patterns #89

Open
greg0ire opened this issue Dec 15, 2016 · 3 comments
Open

logstash-config: how to configure patterns #89

greg0ire opened this issue Dec 15, 2016 · 3 comments

Comments

@greg0ire
Copy link

greg0ire commented Dec 15, 2016

I can't figure out how to use the confd patterns key.

Is it supposed to work yet? It is not documented ATM.

I noticed that the patterns template uses config keys that do not have the /self/service/metadata part like in the config template.

I tried configuring rancher like this :

logstash:
  metadata:
    logstash:
      patterns:
        - ${indexer_patterns}

and like this:

logstash:
  metadata:
    logstash:
      patterns:
        - |
          ${indexer_patterns}

But the patterns file stays empty… @cloudnautique, maybe you can help?

@mojogitoverhere
Copy link

Your rancher-compose files are correct. Like you said, the problem is the keys in the logstash confd config template are wrong. The PR to fix it has been open since May 2016 but still hasn't been merged #65.

@0ff
Copy link

0ff commented Feb 2, 2017

For the time being (until #65 is merged) you could use our patched image in rancher to restore functionality: simpletechs/rancher_logstash-config:v0.2.0-smpl1. The only change is the fixed patterns.tmpl.

You can then use the patterns like this:

logstash-indexer:
    metadata:
      logstash: &id002
        filters: |-
          grok {
            patterns_dir => ["/opt/logstash/patterns"]
            match => [
              "message", "%{TEST}"
              ]
            }
        patterns:
          test: |-
            TEST ...

@greg0ire
Copy link
Author

greg0ire commented Feb 2, 2017

Thanks a lot, that's very helpful, but I found a workaround in the meantime (not using patterns_dir IIRC)

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

No branches or pull requests

3 participants