Change the mapping of a field in Kibana from String to Double












1















I am capturing live streaming of data and processing it. I configured my logstash.conf file.



I started my ElasticSearch, Logstash and Kibana.



I created my index in kibana and when I do a get index in the dev tools,



I have something like this



    "message": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}


I want to change the type of message from String to Double. How can I do it?










share|improve this question



























    1















    I am capturing live streaming of data and processing it. I configured my logstash.conf file.



    I started my ElasticSearch, Logstash and Kibana.



    I created my index in kibana and when I do a get index in the dev tools,



    I have something like this



        "message": {
    "type": "text",
    "fields": {
    "keyword": {
    "type": "keyword",
    "ignore_above": 256
    }
    }
    }


    I want to change the type of message from String to Double. How can I do it?










    share|improve this question

























      1












      1








      1








      I am capturing live streaming of data and processing it. I configured my logstash.conf file.



      I started my ElasticSearch, Logstash and Kibana.



      I created my index in kibana and when I do a get index in the dev tools,



      I have something like this



          "message": {
      "type": "text",
      "fields": {
      "keyword": {
      "type": "keyword",
      "ignore_above": 256
      }
      }
      }


      I want to change the type of message from String to Double. How can I do it?










      share|improve this question














      I am capturing live streaming of data and processing it. I configured my logstash.conf file.



      I started my ElasticSearch, Logstash and Kibana.



      I created my index in kibana and when I do a get index in the dev tools,



      I have something like this



          "message": {
      "type": "text",
      "fields": {
      "keyword": {
      "type": "keyword",
      "ignore_above": 256
      }
      }
      }


      I want to change the type of message from String to Double. How can I do it?







      scala elasticsearch logstash spark-streaming kibana






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 20 '18 at 23:29









      PanicPanic

      287




      287
























          2 Answers
          2






          active

          oldest

          votes


















          1














          You can't change mapping after an index is created - you'll have to create the mapping yourself in a new index explicitly create the fields/types you need:
          https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html



          then re-index from the old to the new index:
          https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html



          Note the type you want is 'double' not 'Double':
          https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html






          share|improve this answer































            1














            Changing the data type of a field in Elasticsearch(ES) is a breaking change. In your case, you need an update the mapping and update in ES.



            Please use https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html to verify, that mapping is updated successfully in ES.



            Reindex API requires _source to be enabled, Please refer https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html for more information on _source field and whether it's enabled in your case.



            If it's not enabled in your case, then the only option you have it to delete the old index(which has older mapping) and create it again with the new mapping.



            Let me know if you have any doubt or face any issue implementing this.






            share|improve this answer
























            • I created a new index and used the filter-mutate functionality on the data I got from ElasticSearch. It worked.

              – Panic
              Nov 21 '18 at 13:35











            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%2f53403165%2fchange-the-mapping-of-a-field-in-kibana-from-string-to-double%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            You can't change mapping after an index is created - you'll have to create the mapping yourself in a new index explicitly create the fields/types you need:
            https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html



            then re-index from the old to the new index:
            https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html



            Note the type you want is 'double' not 'Double':
            https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html






            share|improve this answer




























              1














              You can't change mapping after an index is created - you'll have to create the mapping yourself in a new index explicitly create the fields/types you need:
              https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html



              then re-index from the old to the new index:
              https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html



              Note the type you want is 'double' not 'Double':
              https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html






              share|improve this answer


























                1












                1








                1







                You can't change mapping after an index is created - you'll have to create the mapping yourself in a new index explicitly create the fields/types you need:
                https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html



                then re-index from the old to the new index:
                https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html



                Note the type you want is 'double' not 'Double':
                https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html






                share|improve this answer













                You can't change mapping after an index is created - you'll have to create the mapping yourself in a new index explicitly create the fields/types you need:
                https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping.html



                then re-index from the old to the new index:
                https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-reindex.html



                Note the type you want is 'double' not 'Double':
                https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 21 '18 at 2:37









                BWatsBWats

                92




                92

























                    1














                    Changing the data type of a field in Elasticsearch(ES) is a breaking change. In your case, you need an update the mapping and update in ES.



                    Please use https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html to verify, that mapping is updated successfully in ES.



                    Reindex API requires _source to be enabled, Please refer https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html for more information on _source field and whether it's enabled in your case.



                    If it's not enabled in your case, then the only option you have it to delete the old index(which has older mapping) and create it again with the new mapping.



                    Let me know if you have any doubt or face any issue implementing this.






                    share|improve this answer
























                    • I created a new index and used the filter-mutate functionality on the data I got from ElasticSearch. It worked.

                      – Panic
                      Nov 21 '18 at 13:35
















                    1














                    Changing the data type of a field in Elasticsearch(ES) is a breaking change. In your case, you need an update the mapping and update in ES.



                    Please use https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html to verify, that mapping is updated successfully in ES.



                    Reindex API requires _source to be enabled, Please refer https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html for more information on _source field and whether it's enabled in your case.



                    If it's not enabled in your case, then the only option you have it to delete the old index(which has older mapping) and create it again with the new mapping.



                    Let me know if you have any doubt or face any issue implementing this.






                    share|improve this answer
























                    • I created a new index and used the filter-mutate functionality on the data I got from ElasticSearch. It worked.

                      – Panic
                      Nov 21 '18 at 13:35














                    1












                    1








                    1







                    Changing the data type of a field in Elasticsearch(ES) is a breaking change. In your case, you need an update the mapping and update in ES.



                    Please use https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html to verify, that mapping is updated successfully in ES.



                    Reindex API requires _source to be enabled, Please refer https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html for more information on _source field and whether it's enabled in your case.



                    If it's not enabled in your case, then the only option you have it to delete the old index(which has older mapping) and create it again with the new mapping.



                    Let me know if you have any doubt or face any issue implementing this.






                    share|improve this answer













                    Changing the data type of a field in Elasticsearch(ES) is a breaking change. In your case, you need an update the mapping and update in ES.



                    Please use https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-get-mapping.html to verify, that mapping is updated successfully in ES.



                    Reindex API requires _source to be enabled, Please refer https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-source-field.html for more information on _source field and whether it's enabled in your case.



                    If it's not enabled in your case, then the only option you have it to delete the old index(which has older mapping) and create it again with the new mapping.



                    Let me know if you have any doubt or face any issue implementing this.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 21 '18 at 4:37









                    Amit KhandelwalAmit Khandelwal

                    4,54121533




                    4,54121533













                    • I created a new index and used the filter-mutate functionality on the data I got from ElasticSearch. It worked.

                      – Panic
                      Nov 21 '18 at 13:35



















                    • I created a new index and used the filter-mutate functionality on the data I got from ElasticSearch. It worked.

                      – Panic
                      Nov 21 '18 at 13:35

















                    I created a new index and used the filter-mutate functionality on the data I got from ElasticSearch. It worked.

                    – Panic
                    Nov 21 '18 at 13:35





                    I created a new index and used the filter-mutate functionality on the data I got from ElasticSearch. It worked.

                    – Panic
                    Nov 21 '18 at 13:35


















                    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%2f53403165%2fchange-the-mapping-of-a-field-in-kibana-from-string-to-double%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

                    mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

                    How to change which sound is reproduced for terminal bell?

                    Can I use Tabulator js library in my java Spring + Thymeleaf project?