@aaron-nimocks I think you just put me on the right track.
I don't have any logstash-*
index created, even after sending data, which seemed surprising. (For reference Logstash typically does this automatically.)
So I ran a search using GET /_search
, and the returned result was:
{
"took" : 7,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 780,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : ".ds-logs-generic-default-2021.08.16-000001",
"_id" : "W6QtT3sBfV7XNDbtOnEc",
"_score" : 1.0,
"_source" : {
"@version" : "1",
"@timestamp" : "2021-08-16T13:36:08.869Z",
"port" : 32878,
"host" : {
"name" : "gateway"
},
"message" : "Hi, Aaron!",
"data_stream" : {
"type" : "logs",
"dataset" : "generic",
"namespace" : "default"
}
}
},
// ...
Notice how the documents ended up in the .ds-logs-generic-default-2021.08.16-000001
index, instead of the expected logstash-...
.
This index doesn't seem to have any index template that applies to it, but it has the following mapping (GET /.ds-logs-generic-default-2021.08.16-000001/_mapping
):
{
".ds-logs-generic-default-2021.08.16-000001" : {
"mappings" : {
"_data_stream_timestamp" : {
"enabled" : true
},
"dynamic_templates" : [
{
"match_ip" : {
"match" : "ip",
"match_mapping_type" : "string",
"mapping" : {
"type" : "ip"
}
}
},
{
"match_message" : {
"match" : "message",
"match_mapping_type" : "string",
"mapping" : {
"type" : "match_only_text"
}
}
},
{
"strings_as_keyword" : {
"match_mapping_type" : "string",
"mapping" : {
"ignore_above" : 1024,
"type" : "keyword"
}
}
}
],
"date_detection" : false,
"properties" : {
"@timestamp" : {
"type" : "date"
},
"@version" : {
"type" : "keyword",
"ignore_above" : 1024
},
"data_stream" : {
"properties" : {
"dataset" : {
"type" : "constant_keyword",
"value" : "generic"
},
"namespace" : {
"type" : "constant_keyword",
"value" : "default"
},
"type" : {
"type" : "constant_keyword",
"value" : "logs"
}
}
},
"ecs" : {
"properties" : {
"version" : {
"type" : "keyword",
"ignore_above" : 1024
}
}
},
"host" : {
"properties" : {
"name" : {
"type" : "keyword",
"ignore_above" : 1024
}
}
},
"message" : {
"type" : "match_only_text"
},
"port" : {
"type" : "long"
}
}
}
}
}
I'm not sure I understand the result though, it seems like the host.name
entry is simply the result of a dynamic mapping. Is the conclusion that, in the absence of index template, the ECS schema applies implicitly?