Dear Team,
We are trying to update an index using below method in kibana dev console.
Can you please let me know the method to be followed either using curl method or wget method or via a python or shell script to update ?
PUT index-xyz*/_mappings
{
"runtime": {
"exception": {
"type": "keyword",
"script": """
if(doc["stack_trace.keyword"].size() > 0){
String response=doc["stack_trace.keyword"].value;
String exceptionClass = (response.indexOf(':') > 0)?response.substring(0,response.indexOf(':')):"";
emit(exceptionClass);
}
"""
}
}
}
warkolm
(Mark Walkom)
October 18, 2021, 12:38am
2
Does that not work? What is the error?
Looking for executing this via cronjob or via any curl command.
warkolm
(Mark Walkom)
October 18, 2021, 1:29am
4
Why does it needs to be a cron job?
The new index gets created daily and wanted to change mapping as soon as new index is created.
Hence we need this mapping to be applied post few minutes of index creation.
warkolm
(Mark Walkom)
October 18, 2021, 4:24am
6
Ok, well then you are better off using an index template - Index templates | Elasticsearch Guide [7.15] | Elastic
we will use that by exploring index template.
For now can we have a solution to apply mapping change via script or curl command?
warkolm
(Mark Walkom)
October 18, 2021, 4:28am
8
Anything else is up to you to maintain and manage, this is inbuilt technology so is the best solution.
cool.
Can you please help suggesting the method for implementing this solution at index template level?
or share any steps for acheiving this through index template
system
(system)
Closed
November 15, 2021, 4:31am
10
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.