Add new filters and parser
Closes-Bug: PROD-16326
Change-Id: I578f4c53977f3be7a8dac9f934cba497712b6702
diff --git a/fluentd/files/filter/grep.conf b/fluentd/files/filter/grep.conf
new file mode 100644
index 0000000..942fa36
--- /dev/null
+++ b/fluentd/files/filter/grep.conf
@@ -0,0 +1,9 @@
+<filter {{ values.tag }}>
+ @type grep
+ {%- for exclude in values.get('exclude', []) %}
+ exclude{{ loop.index }} {{ exclude.name }} {{ exclude.regexp }}
+ {%- endfor %}
+ {%- for include in values.get('include', []) %}
+ regexp{{ loop.index }} {{ include.name }} {{ include.regexp }}
+ {%- endfor %}
+</filter>
diff --git a/fluentd/files/filter/kubernetes_metadata.conf b/fluentd/files/filter/kubernetes_metadata.conf
new file mode 100644
index 0000000..0993418
--- /dev/null
+++ b/fluentd/files/filter/kubernetes_metadata.conf
@@ -0,0 +1,18 @@
+<filter {{ values.tag }}>
+ @type kubernetes_metadata
+ {%- if values.get('kubernetes_url') %}
+ kubernetes_url {{ values.get('kubernetes_url') }}
+ {%- endif %}
+ {%- if values.get('client_cert') %}
+ client_cert {{ values.get('client_cert') }}
+ {%- endif %}
+ {%- if values.get('client_key') %}
+ client_key {{ values.get('client_key') }}
+ {%- endif %}
+ {%- if values.get('ca_file') %}
+ ca_file {{ values.get('ca_file') }}
+ {%- endif %}
+ {%- if values.get('verify_ssl') is defined %}
+ verify_ssl {{ values.get('verify_ssl') | lower }}
+ {%- endif %}
+</filter>
diff --git a/fluentd/files/parser/json.conf b/fluentd/files/parser/json.conf
new file mode 100644
index 0000000..85cf904
--- /dev/null
+++ b/fluentd/files/parser/json.conf
@@ -0,0 +1,5 @@
+ time_key {{ values.get("time_key", "time") }}
+{%- if values.get('time_format') %}
+ time_format {{ values.time_format }}
+{%- endif %}
+ keep_time_key {{ values.get("keep_time_key", False) | json }}