Elasticsearch Get Index Mapping from a File





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I am looking a way of having index mapping in a file so that it should be loaded when the elasticsearch is starting. Elstic documentation explains how to get so that using a rest call. I know that index mapping template can be use to set a mapping before creating the index.
Anyone can help me how to read the index mappings from a file?



I will store the mapping details in a text file and then I want to upload the file to the elastic search.










share|improve this question

























  • Can you share what have you tried and what's the issue you are facing in that approach?

    – Nishant Saini
    Nov 25 '18 at 9:11











  • I wanted to read a text file from logstash pipeline. Still I don't have a clue how to proceed?

    – Nu-ONE
    Nov 25 '18 at 13:09











  • So you want a text file being read in by logstash and used as the payload for a index mapping request in elasticsearch? Where the index name will come from?

    – ibexit
    Nov 26 '18 at 12:49


















0















I am looking a way of having index mapping in a file so that it should be loaded when the elasticsearch is starting. Elstic documentation explains how to get so that using a rest call. I know that index mapping template can be use to set a mapping before creating the index.
Anyone can help me how to read the index mappings from a file?



I will store the mapping details in a text file and then I want to upload the file to the elastic search.










share|improve this question

























  • Can you share what have you tried and what's the issue you are facing in that approach?

    – Nishant Saini
    Nov 25 '18 at 9:11











  • I wanted to read a text file from logstash pipeline. Still I don't have a clue how to proceed?

    – Nu-ONE
    Nov 25 '18 at 13:09











  • So you want a text file being read in by logstash and used as the payload for a index mapping request in elasticsearch? Where the index name will come from?

    – ibexit
    Nov 26 '18 at 12:49














0












0








0








I am looking a way of having index mapping in a file so that it should be loaded when the elasticsearch is starting. Elstic documentation explains how to get so that using a rest call. I know that index mapping template can be use to set a mapping before creating the index.
Anyone can help me how to read the index mappings from a file?



I will store the mapping details in a text file and then I want to upload the file to the elastic search.










share|improve this question
















I am looking a way of having index mapping in a file so that it should be loaded when the elasticsearch is starting. Elstic documentation explains how to get so that using a rest call. I know that index mapping template can be use to set a mapping before creating the index.
Anyone can help me how to read the index mappings from a file?



I will store the mapping details in a text file and then I want to upload the file to the elastic search.







elasticsearch indexing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 2 '18 at 17:42







Nu-ONE

















asked Nov 25 '18 at 9:08









Nu-ONENu-ONE

1348




1348













  • Can you share what have you tried and what's the issue you are facing in that approach?

    – Nishant Saini
    Nov 25 '18 at 9:11











  • I wanted to read a text file from logstash pipeline. Still I don't have a clue how to proceed?

    – Nu-ONE
    Nov 25 '18 at 13:09











  • So you want a text file being read in by logstash and used as the payload for a index mapping request in elasticsearch? Where the index name will come from?

    – ibexit
    Nov 26 '18 at 12:49



















  • Can you share what have you tried and what's the issue you are facing in that approach?

    – Nishant Saini
    Nov 25 '18 at 9:11











  • I wanted to read a text file from logstash pipeline. Still I don't have a clue how to proceed?

    – Nu-ONE
    Nov 25 '18 at 13:09











  • So you want a text file being read in by logstash and used as the payload for a index mapping request in elasticsearch? Where the index name will come from?

    – ibexit
    Nov 26 '18 at 12:49

















Can you share what have you tried and what's the issue you are facing in that approach?

– Nishant Saini
Nov 25 '18 at 9:11





Can you share what have you tried and what's the issue you are facing in that approach?

– Nishant Saini
Nov 25 '18 at 9:11













I wanted to read a text file from logstash pipeline. Still I don't have a clue how to proceed?

– Nu-ONE
Nov 25 '18 at 13:09





I wanted to read a text file from logstash pipeline. Still I don't have a clue how to proceed?

– Nu-ONE
Nov 25 '18 at 13:09













So you want a text file being read in by logstash and used as the payload for a index mapping request in elasticsearch? Where the index name will come from?

– ibexit
Nov 26 '18 at 12:49





So you want a text file being read in by logstash and used as the payload for a index mapping request in elasticsearch? Where the index name will come from?

– ibexit
Nov 26 '18 at 12:49












1 Answer
1






active

oldest

votes


















0














if you write your own filters for any index you need to create a mapping template.
logstash has many dynamic options so can map many fields by default.



but please ask your question more clear. what do you mean by reading from file ?
in kibana console you can see the mappings for any index.




  1. open kibana

  2. go to development tools

  3. type in console : GET /index/_mapping


for example if you wanna see all indices for logstash pattern , type : GET /logstash-*/_mapping



note : you can see the full mapping template like : GET /_template/logstash



note : for loading your template to elasticsearch type :curl -XPUT -H 'Content-Type:application/json' http://localhost:9200/_template/test -d@test.template.json



which "test" is your template name and "test.template.json" is your file.



hope this helps and rate if that helped. thanks






share|improve this answer


























  • what I am talking about is, I will store the mapping details in a text file and then I want to upload it to the elastic search

    – Nu-ONE
    Dec 2 '18 at 17:40











  • ok got it... i edited my answer.

    – Mozart4242
    Dec 2 '18 at 19:22












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%2f53466070%2felasticsearch-get-index-mapping-from-a-file%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














if you write your own filters for any index you need to create a mapping template.
logstash has many dynamic options so can map many fields by default.



but please ask your question more clear. what do you mean by reading from file ?
in kibana console you can see the mappings for any index.




  1. open kibana

  2. go to development tools

  3. type in console : GET /index/_mapping


for example if you wanna see all indices for logstash pattern , type : GET /logstash-*/_mapping



note : you can see the full mapping template like : GET /_template/logstash



note : for loading your template to elasticsearch type :curl -XPUT -H 'Content-Type:application/json' http://localhost:9200/_template/test -d@test.template.json



which "test" is your template name and "test.template.json" is your file.



hope this helps and rate if that helped. thanks






share|improve this answer


























  • what I am talking about is, I will store the mapping details in a text file and then I want to upload it to the elastic search

    – Nu-ONE
    Dec 2 '18 at 17:40











  • ok got it... i edited my answer.

    – Mozart4242
    Dec 2 '18 at 19:22
















0














if you write your own filters for any index you need to create a mapping template.
logstash has many dynamic options so can map many fields by default.



but please ask your question more clear. what do you mean by reading from file ?
in kibana console you can see the mappings for any index.




  1. open kibana

  2. go to development tools

  3. type in console : GET /index/_mapping


for example if you wanna see all indices for logstash pattern , type : GET /logstash-*/_mapping



note : you can see the full mapping template like : GET /_template/logstash



note : for loading your template to elasticsearch type :curl -XPUT -H 'Content-Type:application/json' http://localhost:9200/_template/test -d@test.template.json



which "test" is your template name and "test.template.json" is your file.



hope this helps and rate if that helped. thanks






share|improve this answer


























  • what I am talking about is, I will store the mapping details in a text file and then I want to upload it to the elastic search

    – Nu-ONE
    Dec 2 '18 at 17:40











  • ok got it... i edited my answer.

    – Mozart4242
    Dec 2 '18 at 19:22














0












0








0







if you write your own filters for any index you need to create a mapping template.
logstash has many dynamic options so can map many fields by default.



but please ask your question more clear. what do you mean by reading from file ?
in kibana console you can see the mappings for any index.




  1. open kibana

  2. go to development tools

  3. type in console : GET /index/_mapping


for example if you wanna see all indices for logstash pattern , type : GET /logstash-*/_mapping



note : you can see the full mapping template like : GET /_template/logstash



note : for loading your template to elasticsearch type :curl -XPUT -H 'Content-Type:application/json' http://localhost:9200/_template/test -d@test.template.json



which "test" is your template name and "test.template.json" is your file.



hope this helps and rate if that helped. thanks






share|improve this answer















if you write your own filters for any index you need to create a mapping template.
logstash has many dynamic options so can map many fields by default.



but please ask your question more clear. what do you mean by reading from file ?
in kibana console you can see the mappings for any index.




  1. open kibana

  2. go to development tools

  3. type in console : GET /index/_mapping


for example if you wanna see all indices for logstash pattern , type : GET /logstash-*/_mapping



note : you can see the full mapping template like : GET /_template/logstash



note : for loading your template to elasticsearch type :curl -XPUT -H 'Content-Type:application/json' http://localhost:9200/_template/test -d@test.template.json



which "test" is your template name and "test.template.json" is your file.



hope this helps and rate if that helped. thanks







share|improve this answer














share|improve this answer



share|improve this answer








edited Dec 2 '18 at 19:27

























answered Dec 2 '18 at 9:32









Mozart4242Mozart4242

327




327













  • what I am talking about is, I will store the mapping details in a text file and then I want to upload it to the elastic search

    – Nu-ONE
    Dec 2 '18 at 17:40











  • ok got it... i edited my answer.

    – Mozart4242
    Dec 2 '18 at 19:22



















  • what I am talking about is, I will store the mapping details in a text file and then I want to upload it to the elastic search

    – Nu-ONE
    Dec 2 '18 at 17:40











  • ok got it... i edited my answer.

    – Mozart4242
    Dec 2 '18 at 19:22

















what I am talking about is, I will store the mapping details in a text file and then I want to upload it to the elastic search

– Nu-ONE
Dec 2 '18 at 17:40





what I am talking about is, I will store the mapping details in a text file and then I want to upload it to the elastic search

– Nu-ONE
Dec 2 '18 at 17:40













ok got it... i edited my answer.

– Mozart4242
Dec 2 '18 at 19:22





ok got it... i edited my answer.

– Mozart4242
Dec 2 '18 at 19:22




















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%2f53466070%2felasticsearch-get-index-mapping-from-a-file%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







這個網誌中的熱門文章

Xamarin.form Move up view when keyboard appear

Post-Redirect-Get with Spring WebFlux and Thymeleaf

Anylogic : not able to use stopDelay()