Add support for using custom Logstash patterns
A user may want to define and use Logstash patterns. This commit adds support to copy them into the Monasca Log Transformer container. In the future support could be added for other Logstash containers. Change-Id: Id8cde14af6dc7f49714f6b1cb878882d0048d293
This commit is contained in:
parent
3731da0b79
commit
65b9756127
@ -208,6 +208,41 @@
|
|||||||
notify:
|
notify:
|
||||||
- Restart monasca-log-transformer container
|
- Restart monasca-log-transformer container
|
||||||
|
|
||||||
|
- name: Ensuring logstash patterns folder exists
|
||||||
|
vars:
|
||||||
|
service: "{{ monasca_services['monasca-log-transformer'] }}"
|
||||||
|
file:
|
||||||
|
path: "{{ node_config_directory }}/monasca-log-transformer/logstash_patterns"
|
||||||
|
state: "directory"
|
||||||
|
mode: "0770"
|
||||||
|
become: true
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups[service['group']]
|
||||||
|
- service.enabled | bool
|
||||||
|
|
||||||
|
- name: Find custom logstash patterns
|
||||||
|
local_action:
|
||||||
|
module: find
|
||||||
|
path: "{{ node_custom_config }}/monasca/logstash_patterns"
|
||||||
|
pattern: "*"
|
||||||
|
run_once: True
|
||||||
|
register: monasca_custom_logstash_patterns
|
||||||
|
|
||||||
|
- name: Copying over custom logstash patterns
|
||||||
|
vars:
|
||||||
|
service: "{{ monasca_services['monasca-log-transformer'] }}"
|
||||||
|
template:
|
||||||
|
src: "{{ item.path }}"
|
||||||
|
dest: "{{ node_config_directory }}/monasca-log-transformer/logstash_patterns/{{ item.path | basename }}"
|
||||||
|
mode: "0660"
|
||||||
|
with_items: "{{ monasca_custom_logstash_patterns.files }}"
|
||||||
|
become: true
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups[service['group']]
|
||||||
|
- service.enabled | bool
|
||||||
|
notify:
|
||||||
|
- Restart monasca-log-transformer container
|
||||||
|
|
||||||
- name: Copying over monasca-log-persister config
|
- name: Copying over monasca-log-persister config
|
||||||
vars:
|
vars:
|
||||||
service: "{{ monasca_services['monasca-log-persister'] }}"
|
service: "{{ monasca_services['monasca-log-persister'] }}"
|
||||||
|
@ -6,6 +6,13 @@
|
|||||||
"dest": "/etc/logstash/conf.d/log-transformer.conf",
|
"dest": "/etc/logstash/conf.d/log-transformer.conf",
|
||||||
"owner": "logstash",
|
"owner": "logstash",
|
||||||
"perm": "0600"
|
"perm": "0600"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/logstash_patterns/*",
|
||||||
|
"dest": "/etc/logstash/conf.d/patterns/",
|
||||||
|
"owner": "logstash",
|
||||||
|
"perm": "0600",
|
||||||
|
"optional": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"permissions": [
|
"permissions": [
|
||||||
|
Loading…
Reference in New Issue
Block a user