Skip to content

Commit 18a33c9

Browse files
authored
Merge pull request #129 from sasagarw/clean-templates
LOG-1379: Cleanup ES index templates
2 parents efc2cbf + 57cb1f0 commit 18a33c9

File tree

11 files changed

+34
-28
lines changed

11 files changed

+34
-28
lines changed
File renamed without changes.

namespaces/kubernetes.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,19 @@ namespace:
194194
example: Normal
195195
description: >
196196
Type of this event (Normal, Warning), new types could be added in the future
197+
198+
- name: flat_labels
199+
type: keyword
200+
example: [
201+
"app=openshift-kube-scheduler",
202+
"revision=8",
203+
"scheduler=true"
204+
]
205+
norms: true
206+
description: >
207+
Flattened Labels attached to the OpenShift object.
208+
Each label name is a subfield of labels field.
209+
It also contains custom labels added in CRDs. It will be an array.
197210
198211
doc_sections:
199212
- ["pod_log", "Openshift logging metadata"]

templates/Makefile

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,23 @@ TEMPLATE_NAME = com.redhat.viaq-openshift
22

33
.PHONY: all templates index_pattern
44

5-
INDEX_PATTERN_DIRS = openshift,collectd_metrics
5+
INDEX_PATTERN_DIR = openshift
66

77
all: templates index_pattern
88

99
# Clean all index templates and index patterns generated during 'make'
1010
clean:
11-
for dir in {$(INDEX_PATTERN_DIRS)}; do \
12-
cd $$dir ; \
13-
make clean; \
14-
cd .. ; \
15-
done
11+
cd $(INDEX_PATTERN_DIR) ; \
12+
make clean; \
13+
cd .. ; \
1614
rm *.index-pattern.json
1715

1816
templates:
19-
for dir in {$(INDEX_PATTERN_DIRS)}; do \
20-
cd $$dir ; \
21-
make all; \
22-
cd .. ; \
23-
done
17+
cd $(INDEX_PATTERN_DIR) ; \
18+
make all; \
19+
cd .. ; \
2420

2521
index_pattern:
2622
python3 ../scripts/concat_index_pattern_fields.py \
27-
"$(INDEX_PATTERN_DIRS)" "*.index-pattern.json" \
23+
"$(INDEX_PATTERN_DIR)" "*.index-pattern.json" \
2824
"$(TEMPLATE_NAME).<ES_VERSION>.index-pattern.json"
File renamed without changes.

templates/openshift/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ viaq openshift index templates for ElasticSearch and index patterns for Kibana
44
The template files are automatically generated.
55
Please _do not edit_ the files directly.
66

7-
In order to edit the template please modify [objects.yml](objects.yml) and the respective object type files.
7+
In order to edit the template please modify [template-operations.yml](template-operations.yml), [template-project.yml](template-project.yml) and the respective namespace files referenced there.
88

99
To rebuild the template, run:
10-
> python ../scripts/generate_template.py . ../../objects_dir
10+
> make
1111
1212
For details about the mapping please see [ElasticSearch reference](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-templates.html) and [Kibana reference](https://www.elastic.co/guide/en/kibana/current/index-patterns.html)
1313

@@ -18,10 +18,10 @@ This file contains the skeleton of the template without the mappings section.
1818
by sections:
1919
`aliases`: Aliases for the indices produces from the template. Aliases will be automatically generated along with the indices in future.
2020
`mappings`: mappings section
21-
`_default_`: default mapping skeleton. It is the only mapping present in the skeleton. Other mappings from [fields.yml](fields.yml) will copy this skeleton.
21+
`_default_`: default mapping skeleton. It is the only mapping present in the skeleton. Other mappings from [template-operations.yml](template-operations.yml), [template-project.yml](template-project.yml) will copy this skeleton.
2222
`date_detection`: we force no date detection in the unknown fields.
2323
`dynamic_templates`: describes the mapping for autocreated fields.
24-
`properties`: empty section that is populated with the content from [fields.yml](fields.yml)
24+
`properties`: empty section that is populated with the content from [template-operations.yml](template-operations.yml), [template-project.yml](template-project.yml)
2525
`order`: order of the template. lower order templates are applied first.
2626
`settings`: various settings
2727
`index_patterns`: indices that will be matched by this template

templates/openshift/template-operations.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ elasticsearch_template:
88
order: 10
99

1010
namespaces:
11-
- rsyslog.yml
1211
- systemd.yml
1312
- kubernetes.yml
1413
- docker.yml
1514
- pipeline_metadata.yml
1615
- ovirt.yml
1716
- aushape.yml
1817
- tlog.yml
19-
# - openshift/app_log.yml
18+
# - rsyslog.yml
19+
# - openshift/app_log.yml

templates/openshift/template-project.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@ elasticsearch_template:
88
order: 10
99

1010
namespaces:
11-
- rsyslog.yml
1211
- systemd.yml
1312
- kubernetes.yml
1413
- docker.yml
1514
- pipeline_metadata.yml
1615
- ovirt.yml
1716
- aushape.yml
1817
- tlog.yml
19-
# - openshift/app_log.yml
18+
# - rsyslog.yml
19+
# - openshift/app_log.yml

templates/skeleton.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,5 @@
6969
}
7070
},
7171
"order": 10,
72-
"settings": {
73-
"index.refresh_interval": "5s"
74-
},
7572
"index_patterns": "logstash-*"
7673
}

0 commit comments

Comments
 (0)