nilaksha
(Nilaksha Chandula)
March 10, 2023, 10:17am
1
I'm using latest version of 8.6.2 kibana and i need to change the index pattern in kibana Data View to visualize data dynamically. so i have to do it using kibana rest API and found Data View Update API Documentation. but when I run update request on dev tools for existing Data view id, it shows not found error.
here the request sent from dev tools
POST kbn:/api/data_views/data-view/bce27b39-28b9-4f9e-ab15-e92e38140949
{
"data_view": {
"title": "insight_*"
}
}
is there is any way to fix this issue.
nickpeihl
(Nick Peihl)
March 10, 2023, 4:46pm
2
Hi Nilaksha. You have an extra /
between kbn:
and api
in the POST URL. Try
POST kbn:api/data_views/data-view/bce27b39-28b9-4f9e-ab15-e92e38140949
{
"data_view": {
"title": "insight_*"
}
}
nilaksha
(Nilaksha Chandula)
March 11, 2023, 2:26pm
3
I tried it. but still getting 404 not found
stephenb
(Stephen Brown)
March 11, 2023, 3:49pm
4
Hi @nilaksha Welcome to the Community!
I just ran this in 8.6.2.
POST kbn:api/data_views/data_view
{
"data_view": {
"title": "logstash-*",
"name": "My Logstash Data View"
}
}
#results
{
"data_view": {
"id": "67b6bac1-e601-48da-9e02-2e5e9fa37eb5",
"version": "WzU0MCwyXQ==",
"title": "logstash-*",
"sourceFilters": [],
"fields": {},
"typeMeta": {},
"fieldFormats": {},
"runtimeFieldMap": {},
"fieldAttrs": {},
"allowNoIndex": false,
"name": "My Logstash Data View"
}
}
Then ran the update
POST kbn:/api/data_views/data_view/67b6bac1-e601-48da-9e02-2e5e9fa37eb5
{
"data_view": {
"title": "logstash-*",
"name": "My Logstash Updated Data View"
}
}
# Results
{
"data_view": {
"id": "67b6bac1-e601-48da-9e02-2e5e9fa37eb5",
"version": "WzU2MCwyXQ==",
"title": "logstash-*",
"sourceFilters": [],
"fields": {},
"typeMeta": {},
"fieldFormats": {},
"runtimeFieldMap": {},
"fieldAttrs": {},
"allowNoIndex": false,
"name": "My Logstash Updated Data View"
}
}
Please show us the same commands in text with the same sequence.... perhaps you have a cut and paste issue with the ID.
nilaksha
(Nilaksha Chandula)
March 11, 2023, 4:14pm
5
Thank you! this one is worked and I checked the difference of the text in the command. It is a syntax issue with my command.
but i copied it from kibana documentation.
Thanks for the help.
1 Like
nickpeihl
(Nick Peihl)
March 20, 2023, 3:19pm
6
system
(system)
Closed
April 17, 2023, 3:20pm
7
This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.