Skip to content

Commit

Permalink
Merge branch 'main' into ingest-geoip-boundary-refactor-wip
Browse files Browse the repository at this point in the history
  • Loading branch information
joegallo committed Oct 9, 2024
2 parents 70d4058 + adba420 commit 7b56082
Show file tree
Hide file tree
Showing 3 changed files with 263 additions and 0 deletions.
3 changes: 3 additions & 0 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ tests:
- class: org.elasticsearch.backwards.MixedClusterClientYamlTestSuiteIT
method: test {p0=synonyms/60_synonym_rule_get/Synonym rule not found}
issue: https://github.com/elastic/elasticsearch/issues/114444
- class: org.elasticsearch.xpack.inference.InferenceRestIT
method: test {p0=inference/30_semantic_text_inference/Calculates embeddings using the default ELSER 2 endpoint}
issue: https://github.com/elastic/elasticsearch/issues/114412

# Examples:
#
Expand Down
6 changes: 6 additions & 0 deletions x-pack/plugin/logsdb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ base {
archivesName = 'x-pack-logsdb'
}

restResources {
restApi {
include 'bulk', 'search', '_common', 'indices', 'index', 'cluster', 'data_stream', 'ingest', 'cat', 'capabilities'
}
}

dependencies {
compileOnly project(path: xpackModule('core'))
testImplementation(testArtifact(project(xpackModule('core'))))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
---
create logsdb data stream with host.name as keyword:
- requires:
cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ]
reason: support for normalizer on keyword fields

- do:
cluster.put_component_template:
name: "logsdb-mappings"
body:
template:
settings:
mode: "logsdb"
mappings:
properties:
host.name:
type: "keyword"

- do:
indices.put_index_template:
name: "logsdb-index-template"
body:
index_patterns: ["logsdb"]
data_stream: {}
composed_of: ["logsdb-mappings"]

- do:
indices.create_data_stream:
name: "logsdb"

- is_true: acknowledged

---
create logsdb data stream with host.name as keyword and timestamp as date:
- requires:
cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ]
reason: support for normalizer on keyword fields

- do:
cluster.put_component_template:
name: "logsdb-mappings"
body:
template:
settings:
mode: "logsdb"
mappings:
properties:
host.name:
type: "keyword"
"@timestamp":
type: "date"

- do:
indices.put_index_template:
name: "logsdb-index-template"
body:
index_patterns: ["logsdb"]
data_stream: {}
composed_of: ["logsdb-mappings"]

- do:
indices.create_data_stream:
name: "logsdb"

- is_true: acknowledged

---
create logsdb data stream with host as keyword:
- requires:
cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ]
reason: support for normalizer on keyword fields

- do:
cluster.put_component_template:
name: "logsdb-mappings"
body:
template:
settings:
mode: "logsdb"
mappings:
properties:
host:
type: "keyword"

- do:
indices.put_index_template:
name: "logsdb-index-template"
body:
index_patterns: ["logsdb"]
data_stream: {}
composed_of: ["logsdb-mappings"]

- do:
catch: bad_request
indices.create_data_stream:
name: "logsdb"

- match: { error.type: "mapper_parsing_exception" }
- match: { error.reason: "Failed to parse mapping: can't merge a non object mapping [host] with an object mapping" }

---
create logsdb data stream with host as text and multi fields:
- requires:
cluster_features: [ "mapper.keyword_normalizer_synthetic_source" ]
reason: support for normalizer on keyword fields

- do:
cluster.put_component_template:
name: "logsdb-mappings"
body:
template:
settings:
mode: "logsdb"
mappings:
properties:
host:
type: "text"
fields:
keyword:
ignore_above: 256
type: "keyword"
"@timestamp":
type: "date"
format: "strict_date_optional_time"

- do:
indices.put_index_template:
name: "logsdb-index-template"
body:
index_patterns: ["logsdb"]
data_stream: {}
composed_of: ["logsdb-mappings"]

- do:
catch: bad_request
indices.create_data_stream:
name: "logsdb"

- match: { error.type: "mapper_parsing_exception" }
- match: { error.reason: "Failed to parse mapping: can't merge a non object mapping [host] with an object mapping" }

---
create logsdb data stream with host as text:
- requires:
cluster_features: ["mapper.keyword_normalizer_synthetic_source"]
reason: "Support for normalizer on keyword fields"

- do:
cluster.put_component_template:
name: "logsdb-mappings"
body:
template:
settings:
mode: "logsdb"
mappings:
properties:
host:
type: "text"
"@timestamp":
type: "date"
format: "strict_date_optional_time"

- do:
indices.put_index_template:
name: "logsdb-index-template"
body:
index_patterns: ["logsdb"]
data_stream: {}
composed_of: ["logsdb-mappings"]

- do:
catch: bad_request
indices.create_data_stream:
name: "logsdb"

- match: { error.type: "mapper_parsing_exception" }
- match: { error.reason: "Failed to parse mapping: can't merge a non object mapping [host] with an object mapping" }

---
create logsdb data stream with host as text and name as double:
- requires:
cluster_features: ["mapper.keyword_normalizer_synthetic_source"]
reason: "Support for normalizer on keyword fields"

- do:
cluster.put_component_template:
name: "logsdb-mappings"
body:
template:
settings:
mode: "logsdb"
mappings:
properties:
host:
type: "text"
fields:
name:
type: "double"
"@timestamp":
type: "date"
format: "strict_date_optional_time"

- do:
indices.put_index_template:
name: "logsdb-index-template"
body:
index_patterns: ["logsdb"]
data_stream: {}
composed_of: ["logsdb-mappings"]

- do:
catch: bad_request
indices.create_data_stream:
name: "logsdb"

- match: { error.type: "mapper_parsing_exception" }
- match: { error.reason: "Failed to parse mapping: can't merge a non object mapping [host] with an object mapping" }

---
create logsdb data stream with timestamp object mapping:
- requires:
cluster_features: ["mapper.keyword_normalizer_synthetic_source"]
reason: "Support for normalizer on keyword fields"

- do:
cluster.put_component_template:
name: "logsdb-mappings"
body:
template:
settings:
mode: "logsdb"
mappings:
properties:
host:
properties:
name:
type: "keyword"
"@timestamp":
properties:
date:
type: "date"
format: "strict_date_optional_time"

- do:
catch: bad_request
indices.put_index_template:
name: "logsdb-index-template"
body:
index_patterns: ["logsdb"]
data_stream: {}
composed_of: ["logsdb-mappings"]

- match: { error.type: "illegal_argument_exception" }
- match: { error.reason: "composable template [logsdb-index-template] template after composition with component templates [logsdb-mappings] is invalid" }

0 comments on commit 7b56082

Please sign in to comment.