delete time based indices on elastic search older than 30 days using date math expression in JAVA gives indexNotExists exception The Next CEO of Stack OverflowELK stack pulling in older logsUpgrade of elastic search from 1.3.2 to 1.4.0.beata 1 and installing Kibana 4 beta versionHow to delete older logs in ELK to give each application a certain disk quotadeciphering the start and end date encoding of an elasticsearch query in kibana dashboardUnable to fetch mapping in Kibana install on Windows 7Can variables be used in elasticsearch index templates?How to get creation time of indices in elastic search using JestHow to visualize data with validity period in Elasticsearch / Kibana?Kibana shows indices that don't exist in elasticDelete elasticsearch old indices based on created time

Audio Conversion With ADS1243

Expectation in a stochastic differential equation

If Nick Fury and Coulson already knew about aliens (Kree and Skrull) why did they wait until Thor's appearance to start making weapons?

"Eavesdropping" vs "Listen in on"

Is there such a thing as a proper verb, like a proper noun?

Decide between Polyglossia and Babel for LuaLaTeX in 2019

Help! I cannot understand this game’s notations!

Are the names of these months realistic?

What would be the main consequences for a country leaving the WTO?

Is French Guiana a (hard) EU border?

Can you teleport closer to a creature you are Frightened of?

Is it correct to say moon starry nights?

IC has pull-down resistors on SMBus lines?

Expressing the idea of having a very busy time

Why is information "lost" when it got into a black hole?

Spaces in which all closed sets are regular closed

Redefining symbol midway through a document

Can Sneak Attack be used when hitting with an improvised weapon?

How to avoid supervisors with prejudiced views?

Do scriptures give a method to recognize a truly self-realized person/jivanmukta?

Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico

How to get the last not-null value in an ordered column of a huge table?

TikZ: How to fill area with a special pattern?

Does the Idaho Potato Commission associate potato skins with healthy eating?



delete time based indices on elastic search older than 30 days using date math expression in JAVA gives indexNotExists exception



The Next CEO of Stack OverflowELK stack pulling in older logsUpgrade of elastic search from 1.3.2 to 1.4.0.beata 1 and installing Kibana 4 beta versionHow to delete older logs in ELK to give each application a certain disk quotadeciphering the start and end date encoding of an elasticsearch query in kibana dashboardUnable to fetch mapping in Kibana install on Windows 7Can variables be used in elasticsearch index templates?How to get creation time of indices in elastic search using JestHow to visualize data with validity period in Elasticsearch / Kibana?Kibana shows indices that don't exist in elasticDelete elasticsearch old indices based on created time










0















want to delete time based indices on elastic search older than some specific (let's say 30) days using date math expression in JAVA.




Trying to implement following approach in our spring boot application using Transaport Client but getting index not exist exception.
https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html




When the same URI encoded index name (which is passed to DELETE INDEX API) is used to search index using query GET uri_encoded_index_name on kibana, It shows that index exists.



Is there something I am missing out ?

Is there any better approach to do that without using curator and wilcard characters?



code snippet:



String indexName = "<" + indexNameStaticPart + "now/d-30dMMddYYYY>"; 
String encodedIndexName = UriEncoder.encode( indexName ).replace( "/", "%2F" );
AcknowledgedResponse response = client.admin().indices().delete( new DeleteIndexRequest( encodedIndexName ) ).actionGet();


encodedIndexName : %3Cstring__string_string__%7Bnow%2Fd-30d%7BMMddyyyy%7D%7D%3E



kibana:



GET encodedIndexName 
DELETE encodedIndexName









share|improve this question
























  • It probably would help to see some code that leads to your error message :)

    – webwurst
    Mar 7 at 18:05











  • String indexName = "<" + indexNameStaticPart + "now/d-30dMMddYYYY>"; encodedIndexName = UriEncoder.encode( indexName ).replace( "/", "%2F" ); AcknowledgedResponse response = client.admin().indices().delete( new DeleteIndexRequest( encodedIndexName ) ).actionGet();

    – singla_02
    Mar 7 at 18:14











  • You might be interested in reading about Curator: elastic.co/guide/en/elasticsearch/client/curator/current/… It is a tool that you can install that will automatically delete old indices for you, among other features

    – IanGabes
    Mar 7 at 18:17











  • Yeah but I am curious to know why this is not working out

    – singla_02
    Mar 7 at 18:32











  • plus we also need to schedule job to perform index deletion

    – singla_02
    Mar 7 at 19:01















0















want to delete time based indices on elastic search older than some specific (let's say 30) days using date math expression in JAVA.




Trying to implement following approach in our spring boot application using Transaport Client but getting index not exist exception.
https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html




When the same URI encoded index name (which is passed to DELETE INDEX API) is used to search index using query GET uri_encoded_index_name on kibana, It shows that index exists.



Is there something I am missing out ?

Is there any better approach to do that without using curator and wilcard characters?



code snippet:



String indexName = "<" + indexNameStaticPart + "now/d-30dMMddYYYY>"; 
String encodedIndexName = UriEncoder.encode( indexName ).replace( "/", "%2F" );
AcknowledgedResponse response = client.admin().indices().delete( new DeleteIndexRequest( encodedIndexName ) ).actionGet();


encodedIndexName : %3Cstring__string_string__%7Bnow%2Fd-30d%7BMMddyyyy%7D%7D%3E



kibana:



GET encodedIndexName 
DELETE encodedIndexName









share|improve this question
























  • It probably would help to see some code that leads to your error message :)

    – webwurst
    Mar 7 at 18:05











  • String indexName = "<" + indexNameStaticPart + "now/d-30dMMddYYYY>"; encodedIndexName = UriEncoder.encode( indexName ).replace( "/", "%2F" ); AcknowledgedResponse response = client.admin().indices().delete( new DeleteIndexRequest( encodedIndexName ) ).actionGet();

    – singla_02
    Mar 7 at 18:14











  • You might be interested in reading about Curator: elastic.co/guide/en/elasticsearch/client/curator/current/… It is a tool that you can install that will automatically delete old indices for you, among other features

    – IanGabes
    Mar 7 at 18:17











  • Yeah but I am curious to know why this is not working out

    – singla_02
    Mar 7 at 18:32











  • plus we also need to schedule job to perform index deletion

    – singla_02
    Mar 7 at 19:01













0












0








0


0






want to delete time based indices on elastic search older than some specific (let's say 30) days using date math expression in JAVA.




Trying to implement following approach in our spring boot application using Transaport Client but getting index not exist exception.
https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html




When the same URI encoded index name (which is passed to DELETE INDEX API) is used to search index using query GET uri_encoded_index_name on kibana, It shows that index exists.



Is there something I am missing out ?

Is there any better approach to do that without using curator and wilcard characters?



code snippet:



String indexName = "<" + indexNameStaticPart + "now/d-30dMMddYYYY>"; 
String encodedIndexName = UriEncoder.encode( indexName ).replace( "/", "%2F" );
AcknowledgedResponse response = client.admin().indices().delete( new DeleteIndexRequest( encodedIndexName ) ).actionGet();


encodedIndexName : %3Cstring__string_string__%7Bnow%2Fd-30d%7BMMddyyyy%7D%7D%3E



kibana:



GET encodedIndexName 
DELETE encodedIndexName









share|improve this question
















want to delete time based indices on elastic search older than some specific (let's say 30) days using date math expression in JAVA.




Trying to implement following approach in our spring boot application using Transaport Client but getting index not exist exception.
https://www.elastic.co/guide/en/elasticsearch/reference/current/date-math-index-names.html




When the same URI encoded index name (which is passed to DELETE INDEX API) is used to search index using query GET uri_encoded_index_name on kibana, It shows that index exists.



Is there something I am missing out ?

Is there any better approach to do that without using curator and wilcard characters?



code snippet:



String indexName = "<" + indexNameStaticPart + "now/d-30dMMddYYYY>"; 
String encodedIndexName = UriEncoder.encode( indexName ).replace( "/", "%2F" );
AcknowledgedResponse response = client.admin().indices().delete( new DeleteIndexRequest( encodedIndexName ) ).actionGet();


encodedIndexName : %3Cstring__string_string__%7Bnow%2Fd-30d%7BMMddyyyy%7D%7D%3E



kibana:



GET encodedIndexName 
DELETE encodedIndexName






elasticsearch kibana elasticsearch-java-api date-math elasticsearch-indices






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 9 at 14:43







singla_02

















asked Mar 7 at 17:55









singla_02singla_02

13




13












  • It probably would help to see some code that leads to your error message :)

    – webwurst
    Mar 7 at 18:05











  • String indexName = "<" + indexNameStaticPart + "now/d-30dMMddYYYY>"; encodedIndexName = UriEncoder.encode( indexName ).replace( "/", "%2F" ); AcknowledgedResponse response = client.admin().indices().delete( new DeleteIndexRequest( encodedIndexName ) ).actionGet();

    – singla_02
    Mar 7 at 18:14











  • You might be interested in reading about Curator: elastic.co/guide/en/elasticsearch/client/curator/current/… It is a tool that you can install that will automatically delete old indices for you, among other features

    – IanGabes
    Mar 7 at 18:17











  • Yeah but I am curious to know why this is not working out

    – singla_02
    Mar 7 at 18:32











  • plus we also need to schedule job to perform index deletion

    – singla_02
    Mar 7 at 19:01

















  • It probably would help to see some code that leads to your error message :)

    – webwurst
    Mar 7 at 18:05











  • String indexName = "<" + indexNameStaticPart + "now/d-30dMMddYYYY>"; encodedIndexName = UriEncoder.encode( indexName ).replace( "/", "%2F" ); AcknowledgedResponse response = client.admin().indices().delete( new DeleteIndexRequest( encodedIndexName ) ).actionGet();

    – singla_02
    Mar 7 at 18:14











  • You might be interested in reading about Curator: elastic.co/guide/en/elasticsearch/client/curator/current/… It is a tool that you can install that will automatically delete old indices for you, among other features

    – IanGabes
    Mar 7 at 18:17











  • Yeah but I am curious to know why this is not working out

    – singla_02
    Mar 7 at 18:32











  • plus we also need to schedule job to perform index deletion

    – singla_02
    Mar 7 at 19:01
















It probably would help to see some code that leads to your error message :)

– webwurst
Mar 7 at 18:05





It probably would help to see some code that leads to your error message :)

– webwurst
Mar 7 at 18:05













String indexName = "<" + indexNameStaticPart + "now/d-30dMMddYYYY>"; encodedIndexName = UriEncoder.encode( indexName ).replace( "/", "%2F" ); AcknowledgedResponse response = client.admin().indices().delete( new DeleteIndexRequest( encodedIndexName ) ).actionGet();

– singla_02
Mar 7 at 18:14





String indexName = "<" + indexNameStaticPart + "now/d-30dMMddYYYY>"; encodedIndexName = UriEncoder.encode( indexName ).replace( "/", "%2F" ); AcknowledgedResponse response = client.admin().indices().delete( new DeleteIndexRequest( encodedIndexName ) ).actionGet();

– singla_02
Mar 7 at 18:14













You might be interested in reading about Curator: elastic.co/guide/en/elasticsearch/client/curator/current/… It is a tool that you can install that will automatically delete old indices for you, among other features

– IanGabes
Mar 7 at 18:17





You might be interested in reading about Curator: elastic.co/guide/en/elasticsearch/client/curator/current/… It is a tool that you can install that will automatically delete old indices for you, among other features

– IanGabes
Mar 7 at 18:17













Yeah but I am curious to know why this is not working out

– singla_02
Mar 7 at 18:32





Yeah but I am curious to know why this is not working out

– singla_02
Mar 7 at 18:32













plus we also need to schedule job to perform index deletion

– singla_02
Mar 7 at 19:01





plus we also need to schedule job to perform index deletion

– singla_02
Mar 7 at 19:01












1 Answer
1






active

oldest

votes


















0














Try it without URI encoding..



https://discuss.elastic.co/t/delete-time-based-indices-on-elastic-search-older-than-30-days-using-date-math-expression-in-java-gives-indexnotexists-exception/171365






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55050088%2fdelete-time-based-indices-on-elastic-search-older-than-30-days-using-date-math-e%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    Try it without URI encoding..



    https://discuss.elastic.co/t/delete-time-based-indices-on-elastic-search-older-than-30-days-using-date-math-expression-in-java-gives-indexnotexists-exception/171365






    share|improve this answer



























      0














      Try it without URI encoding..



      https://discuss.elastic.co/t/delete-time-based-indices-on-elastic-search-older-than-30-days-using-date-math-expression-in-java-gives-indexnotexists-exception/171365






      share|improve this answer

























        0












        0








        0







        Try it without URI encoding..



        https://discuss.elastic.co/t/delete-time-based-indices-on-elastic-search-older-than-30-days-using-date-math-expression-in-java-gives-indexnotexists-exception/171365






        share|improve this answer













        Try it without URI encoding..



        https://discuss.elastic.co/t/delete-time-based-indices-on-elastic-search-older-than-30-days-using-date-math-expression-in-java-gives-indexnotexists-exception/171365







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 9 at 19:17









        singla_02singla_02

        13




        13





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55050088%2fdelete-time-based-indices-on-elastic-search-older-than-30-days-using-date-math-e%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            AWS Lex not identifying response if by a variable The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) The Ask Question Wizard is Live! Data science time! April 2019 and salary with experienceEnforcing custom enumeration in AWS LEX for slot valuesHow to give response based on user response in Amazon Lex?Intercepting AWS Lambda Response to a AWS Lex QueryLex chat bot error: Reached second execution of fulfillment lambda on the same utteranceamazon lex showing invalid responseLambda response send back to Lex slot?Response card in Amazon lexAmazon Lex - Lambda response return HTML to botHow can I solve 424 (Failed Dependency) (python) obtained from Amazon lex?

            Алба-Юлія

            Захаров Федір Захарович