raghuvelagala opened a new issue, #16186:
URL: https://github.com/apache/pulsar/issues/16186
**Describe the bug**
A clear and concise description of what the bug is.
Pulsar version: apache-pulsar-2.10.0
ES version: 7.17.0
Running an es-sink connector with sink-config field "indexName":
"my-index-%{+yyyy-MM-dd}" as suggested in the documentation.
https://pulsar.apache.org/fr/docs/next/io-elasticsearch-sink/
However whenever the connector consumes a message and pushes to ES, the date
is not being appended to the index name (the date-format seems to be used as-is
and not replaced) :
org.opensearch.OpenSearchStatusException: OpenSearch exception
[type=invalid_index_name_exception, reason=Invalid index name
[my_index-%{+yyyy-MM-dd}], must be lowercase]
at
org.opensearch.rest.BytesRestResponse.errorFromXContent(BytesRestResponse.java:202)
~[?:?]
at
org.opensearch.client.RestHighLevelClient.parseEntity(RestHighLevelClient.java:2075)
~[?:?]
at
org.opensearch.client.RestHighLevelClient.parseResponseException(RestHighLevelClient.java:2052)
~[?:?]
at
org.opensearch.client.RestHighLevelClient.internalPerformRequest(RestHighLevelClient.java:1775)
~[?:?]
at
org.opensearch.client.RestHighLevelClient.performRequest(RestHighLevelClient.java:1728)
~[?:?]
at
org.opensearch.client.RestHighLevelClient.performRequestAndParseEntity(RestHighLevelClient.java:1696)
~[?:?]
at
org.opensearch.client.RestHighLevelClient.index(RestHighLevelClient.java:961)
~[?:?]
at
org.apache.pulsar.io.elasticsearch.ElasticSearchClient.indexDocument(ElasticSearchClient.java:298)
~[?:?]
at
org.apache.pulsar.io.elasticsearch.ElasticSearchSink.write(ElasticSearchSink.java:110)
~[?:?]
at
org.apache.pulsar.functions.instance.JavaInstanceRunnable.sendOutputMessage(JavaInstanceRunnable.java:380)
~[org.apache.pulsar-pulsar-functions-instance-2.10.0.jar:2.10.0]
at
org.apache.pulsar.functions.instance.JavaInstanceRunnable.handleResult(JavaInstanceRunnable.java:363)
~[org.apache.pulsar-pulsar-functions-instance-2.10.0.jar:2.10.0]
at
org.apache.pulsar.functions.instance.JavaInstanceRunnable.run(JavaInstanceRunnable.java:304)
~[org.apache.pulsar-pulsar-functions-instance-2.10.0.jar:2.10.0]
at java.lang.Thread.run(Thread.java:750) [?:1.8.0_322]
Suppressed: org.opensearch.client.ResponseException: method [POST],
host [http://XXXXXXXXXXX:9200], URI
[/my_index-%25%7B+yyyy-MM-dd%7D/_doc?timeout=1m], status line [HTTP/1.1 400 Bad
Request
**To Reproduce**
Steps to reproduce the behavior:
Set ES indexName with date as in the documentation: 'logs-%{+yyyy-MM-dd};
**Expected behavior**
A clear and concise description of what you expected to happen.
An index with current date created in Elasticsearch. E.g. my-index-2022-06-22
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
**Additional context**
Add any other context about the problem here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]