Opensearch Version - 2.12
I’m using opensearch API command to create a data stream and ingest data into it.
the index name generated in data stream is with certain format like
.ds-<data_stream_name>-000001
Is there anyway that using API I could create a custom timeStamp based index name in data stream, like log-, log-2024.05.01 ?
or it is that, data stream would always create a index with such naming format
.ds-<data_stream_name>-000001
I’m using this index template is used for ingesting data to data stream.
PUT _index_template/demo-index-template -d '{
"index_patterns": ["demo-*"],
"data_stream": { },
"priority": 200,
"template": {
"settings": {
"number_of_shards": 2
}
}
}'
also tried fluentd-opensearch plugin to ingest data to opensearch data stream using below configuration, the index name in data stream is remain in same format as .ds-<data_stream_name>-000001 in this case irrespective of using logstash_prefix & logstash_dateformat.
<source>
@type dummy
tag dummy.logs
dummy {"message":"Sample log message"}
interval 50s
</source>
<match dummy.logs>
@type opensearch_data_stream
host indexsearch
port 9200
logstash_format true
logstash_prefix bssc-ds
logstash_dateformat %Y.%m.%d
include_timestamp true
data_stream true
data_stream_name test-ds
</match>