Skip to content
Snippets Groups Projects
Commit 3cca2759 authored by jurgenhaas's avatar jurgenhaas
Browse files

Move index definition into ElasticSearch role

parent b7ebc128
Branches
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ This repository provides a callback plugin that ships Ansible output via FluentD
### Ansible section
Install fluent-logger
Install [fluent-logger-python](https://github.com/fluent/fluent-logger-python)
```
pip install fluent-logger
......@@ -31,7 +31,7 @@ Basic fluentd testing config
```
<source>
type forward
@type forward
port 24224
</source>
```
......
{
"mappings": {
"_default_": {
"_all": {
"norms": false
},
"dynamic_templates": [
{
"strings_as_keyword": {
"mapping": {
"ignore_above": 1024,
"type": "keyword"
},
"match_mapping_type": "string"
}
}
],
"properties": {
"@timestamp": {
"type": "date"
},
"input_type": {
"ignore_above": 1024,
"type": "keyword"
},
"message": {
"norms": false,
"type": "text"
},
"ansible_result": {
"norms": false,
"type": "text"
},
"ansible_facts": {
"norms": false,
"type": "text"
},
"tags": {
"ignore_above": 1024,
"type": "keyword"
},
"type": {
"ignore_above": 1024,
"type": "keyword"
}
}
}
},
"order": 0,
"template": "ansible-*"
}
......@@ -65,6 +65,7 @@ class CallbackModule(CallbackBase):
port=int(os.getenv('FLUENTD_PORT', 24224)),
buffer_overflow_handler=handler
)
self.handler.setFormatter(handler.FluentRecordFormatter())
self.logger.addHandler(self.handler)
self.hostname = socket.gethostname()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment