-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable logsdb for http_logs #646
base: master
Are you sure you want to change the base?
Changes from all commits
caf108e
f8cf526
30813ed
0af701e
0c34e55
8dd15d8
dc51e58
4b69070
88d4659
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"operation": { | ||
"name": "delete-data-stream", | ||
"operation-type": "delete-data-stream", | ||
"only-if-exists": false, | ||
"data-stream": ["logs-181998", "logs-191998", "logs-201998", "logs-211998", "logs-221998", "logs-231998", "logs-241998", "reindexed-logs"] | ||
}, | ||
"tags": ["setup"] | ||
}, | ||
{ | ||
"operation": { | ||
"name": "delete-index", | ||
"operation-type": "delete-index", | ||
"only-if-exists": false, | ||
"index": ["logs-181998", "logs-191998", "logs-201998", "logs-211998", "logs-221998", "logs-231998", "logs-241998", "reindexed-logs"] | ||
}, | ||
"tags": ["setup"] | ||
}, | ||
{ | ||
"operation" : { | ||
"name": "delete-all-index-templates", | ||
"operation-type": "delete-composable-template" | ||
}, | ||
"tags": ["setup"] | ||
}, | ||
{ | ||
"operation": { | ||
"name": "create-all-templates", | ||
"operation-type": "create-composable-template" | ||
}, | ||
"tags": ["setup"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,14 +17,18 @@ | |
"name": "append-no-conflicts-index-only", | ||
"description": "Indexes the whole document corpus using Elasticsearch default settings. We only adjust the number of replicas as we benchmark a single node cluster and Rally will only start the benchmark if the cluster turns green. Document ids are unique so all index operations are append only.", | ||
"schedule": [ | ||
{{ rally.collect(parts="common/setup-schedule.json") }}, | ||
{ | ||
"operation": "delete-index" | ||
}, | ||
{ | ||
{%- if index_mode == "logsdb" or index_type == "data_stream" %} | ||
{%- set indexing_operation_type = "create-data-stream" %} | ||
{%- endif %} | ||
"operation": { | ||
"operation-type": "create-index", | ||
"operation-type": {{ indexing_operation_type | default("create-index") | tojson }}, | ||
"settings": {{index_settings | default({}) | tojson}} | ||
} | ||
}, | ||
"tags": [ | ||
"setup" | ||
] | ||
}, | ||
{ | ||
"name": "check-cluster-health", | ||
|
@@ -77,17 +81,21 @@ | |
"name": "append-sorted-no-conflicts", | ||
"description": "Indexes the whole document corpus in an index sorted by timestamp field in descending order (most recent first) and using a setup that will lead to a lower indexing throughput than the default settings. Document ids are unique so all index operations are append only.", | ||
"schedule": [ | ||
{{ rally.collect(parts="common/setup-schedule.json") }}, | ||
{ | ||
"operation": "delete-index" | ||
}, | ||
{ | ||
{%- if index_mode == "logsdb" or index_type == "data_stream" %} | ||
{%- set indexing_operation_type = "create-data-stream" %} | ||
{%- endif %} | ||
"operation": { | ||
"operation-type": "create-index", | ||
"operation-type": {{ indexing_operation_type | default("create-index") | tojson }}, | ||
"settings": {%- if index_settings is defined %} {{index_settings | tojson}} {%- else %} { | ||
"index.sort.field": "@timestamp", | ||
"index.sort.order": "desc" | ||
}{%- endif %} | ||
} | ||
}, | ||
"tags": [ | ||
"setup" | ||
] | ||
}, | ||
{ | ||
"name": "check-cluster-health", | ||
|
@@ -140,14 +148,21 @@ | |
"name": "append-index-only-with-ingest-pipeline", | ||
"description": "Indexes the whole document corpus using Elasticsearch default settings. We only adjust the number of replicas as we benchmark a single node cluster and Rally will only start the benchmark if the cluster turns green. Document ids are unique so all index operations are append only. Runs the documents through an ingest node pipeline to parse the http logs. May require --elasticsearch-plugins='ingest-geoip' ", | ||
"schedule": [ | ||
{{ rally.collect(parts="common/setup-schedule.json") }}, | ||
{ | ||
"operation": "delete-index" | ||
}, | ||
{ | ||
{%- if index_mode == "logsdb" or index_type == "data_stream" %} | ||
{%- set indexing_operation_type = "create-data-stream" %} | ||
{%- endif %} | ||
"operation": { | ||
"operation-type": "create-index", | ||
"settings": {{index_settings | default({}) | tojson}} | ||
} | ||
"operation-type": {{ indexing_operation_type | default("create-index") | tojson }}, | ||
"settings": {%- if index_settings is defined %} {{index_settings | tojson}} {%- else %} { | ||
"index.sort.field": "@timestamp", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looking at the template, not sure what else can be a good sorting field without knowing the data, I think just sorting by timestamp is good. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is basically nothing there There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a result I think we can use this as an example to udnerstand what happens if |
||
"index.sort.order": "desc" | ||
}{%- endif %} | ||
}, | ||
"tags": [ | ||
"setup" | ||
] | ||
}, | ||
{ | ||
"name": "check-cluster-health", | ||
|
@@ -201,10 +216,9 @@ | |
}, | ||
{ | ||
"name": "update", | ||
"description": "Perform bulk update operations. The update challenge is for standard index use only.", | ||
"schedule": [ | ||
{ | ||
"operation": "delete-index" | ||
}, | ||
{{ rally.collect(parts="common/setup-schedule.json") }}, | ||
{ | ||
"operation": { | ||
"operation-type": "create-index", | ||
|
@@ -268,14 +282,21 @@ | |
"name": "append-no-conflicts-index-reindex-only", | ||
"description": "Indexes the whole document corpus using Elasticsearch default settings. We only adjust the number of replicas as we benchmark a single node cluster and Rally will only start the benchmark if the cluster turns green. Document ids are unique so all index operations are append only. After indexing, same data are reindexed.", | ||
"schedule": [ | ||
{{ rally.collect(parts="common/setup-schedule.json") }}, | ||
{ | ||
"operation": "delete-index" | ||
}, | ||
{ | ||
{%- if index_mode == "logsdb" or index_type == "data_stream" %} | ||
{%- set indexing_operation_type = "create-data-stream" %} | ||
{%- endif %} | ||
"operation": { | ||
"operation-type": "create-index", | ||
"settings": {{index_settings | default({}) | tojson}} | ||
} | ||
"operation-type": {{ indexing_operation_type | default("create-index") | tojson }}, | ||
"settings": {%- if index_settings is defined %} {{index_settings | tojson}} {%- else %} { | ||
"index.sort.field": "@timestamp", | ||
"index.sort.order": "desc" | ||
}{%- endif %} | ||
}, | ||
"tags": [ | ||
"setup" | ||
] | ||
}, | ||
{ | ||
"name": "check-cluster-health", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,84 @@ | ||
{ | ||
"settings": { | ||
{# non-serverless-index-settings-marker-start #}{%- if build_flavor != "serverless" or serverless_operator == true -%} | ||
"index.number_of_shards": {{ number_of_shards | default(5) }}, | ||
"index.number_of_replicas": {{ number_of_replicas | default(0) }}, | ||
"index.requests.cache.enable": false | ||
{%- endif -%}{# non-serverless-index-settings-marker-end #} | ||
}, | ||
"mappings": { | ||
"dynamic": "strict", | ||
"_source": { | ||
"enabled": {{ source_enabled | default(true) | tojson }} | ||
"priority": 101, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to https://www.elastic.co/guide/en/elasticsearch/reference/current/index-templates.html There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used 101 to ensure the template took priority over the built-in one for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was referring to the fact that the standard ones should have 100...so it should be fine for this to have 101 (and have higher priority). I saw some CI failures saying that there is a template priority issue while merging templates. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see
|
||
"index_patterns": ["logs-*", "reindexed-logs"], | ||
{%- if index_mode == "logsdb" or index_type == "data_stream" %} | ||
"data_stream": {}, | ||
{%- endif %} | ||
"template": { | ||
"settings": { | ||
{%- if index_mode %} | ||
"mode": {{ index_mode | tojson }}, | ||
{%- endif -%} | ||
{# non-serverless-index-settings-marker-start -#} | ||
{%- if build_flavor != "serverless" %} | ||
"index.number_of_replicas": {{ number_of_replicas | default(0) | tojson }}, | ||
{%- endif -%} | ||
{%- if build_flavor != "serverless" or serverless_operator == true %} | ||
"index.number_of_shards": {{ number_of_shards | default(5) | tojson }}, | ||
"index.requests.cache.enable": false | ||
{%- endif -%} | ||
{# non-serverless-index-settings-marker-end #} | ||
}, | ||
"properties": { | ||
"@timestamp": { | ||
"format": "strict_date_optional_time", | ||
"type": "date" | ||
}, | ||
"message": { | ||
"type": "wildcard", | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword" | ||
"mappings": { | ||
"dynamic": "strict", | ||
{%- if index_mode != "logsdb" %} | ||
"_source": { | ||
"enabled": {{ source_enabled | default(true) | tojson }} | ||
}, | ||
{%- endif %} | ||
"properties": { | ||
"@timestamp": { | ||
{%- if (ingest_pipeline is defined and ingest_pipeline == "grok") or runtime_fields is defined %} | ||
"format": "strict_date_optional_time", | ||
{%- else %} | ||
"format": "epoch_second", | ||
{%- endif %} | ||
"type": "date" | ||
}, | ||
{%- if runtime_fields is defined %} | ||
"message": { | ||
"type": "wildcard", | ||
"fields": { | ||
"keyword": { | ||
"type": "keyword" | ||
} | ||
} | ||
}, | ||
{%- else %} | ||
"message": { | ||
"type": "keyword", | ||
"index": false, | ||
"doc_values": false | ||
}, | ||
{%- endif %} | ||
"clientip": { | ||
"type": "ip" | ||
}, | ||
"request": { | ||
"type": "match_only_text", | ||
"fields": { | ||
"raw": { | ||
"ignore_above": 256, | ||
"type": "keyword" | ||
} | ||
} | ||
}, | ||
"status": { | ||
"type": "integer" | ||
}, | ||
"size": { | ||
"type": "integer" | ||
}, | ||
"geoip" : { | ||
"properties" : { | ||
"country_name": { "type": "keyword" }, | ||
"city_name": { "type": "keyword" }, | ||
"location" : { "type" : "geo_point" } | ||
} | ||
} | ||
} | ||
}, | ||
} | ||
{%- if runtime_fields is defined %}, | ||
"runtime": { | ||
{%- set sources = [('source', 'message.source'), ('wildcard', 'message'), ('keyword', 'message.keyword')] %} | ||
{%- for source_type, field in sources %} | ||
|
@@ -97,6 +151,6 @@ | |
"type": "keyword", | ||
"script": "emit(params._source.message)" | ||
} | ||
} | ||
}{% endif %} | ||
} | ||
} |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternatively we could just enable logsdb on the plain index and not use data streams. This would make this change a little bit simpler, since this is an index oriented track?
But I think it is fine to use logsdb with data stream here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL logsdb can be enabled on a plain index. I took from https://www.elastic.co/guide/en/elasticsearch/reference/current/logs-data-stream.html it was required to be a data stream.
I would like to leave data stream support for serverless, though I think combining the template into one may have complicated things a bit, so I am thinking of splitting the template into two files: one for a plain index, the other for data stream. WDYT?