Get data view api returns 404 even if the data view exists

Hi i am using the following command to check if the data view exists

 curl -X GET "http://demo.icebreaker.minutuscloud.com/kibana/api/data_views/data_view/3dxp_servicetrace" -H 'kbn-xsrf: true' -u elastic:minutus -k

Elastic is the reverse proxy for kibanaip:5601
This returns a 404 for every data view even if it exists.


{"statusCode":404,"error":"Not Found","message":"Saved object [index-pattern/3dxp_servicetrace] not found"}[

Does it work if you don't go via the proxy?

no it does not. then it gives a 404 not found.

What curl command are you sending for that?

curl -X GET "http://localhost:5601/kibana/api/data_views/data_view/3dxp_servicetrace" -H 'kbn-xsrf: true' -u elastic:password -k

{"statusCode":404,"error":"Not Found","message":"Saved object [index-pattern/3dxp_servicetrace] not found"}

That's not the right path, see Get all data views API | Kibana Guide [8.8] | Elastic

This is giving me all the data views. What if i want a single one? i am referring this doc.

Yeah that's the one, but the syntax you have;

 curl -X GET "http://demo.icebreaker.minutuscloud.com/kibana/api/data_views/data_view/3dxp_servicetrace" -H 'kbn-xsrf: true' -u elastic:minutus -k

Isn't what the docs have;

curl -X GET "localhost:5601/api/data_views" -H 'kbn-xsrf: true'

How can i fetch a specific data view?
The output for this command
curl -X GET "localhost:5601/kibana/api/data_views" -H 'kbn-xsrf: true'
is

{"data_view":[{"id":"314a7324-7d7d-473f-a107-6ef297872123","namespaces":["default"],"title":"jenkins-logstash*","typeMeta":{},"name":"jenkins job logs using logstash plugin"},{"id":"ddb436fc-92c6-4b22-98c1-4f0c0ba6cf96","namespaces":["default"],"title":"apache_syslog*","typeMeta":{},"name":"apache_syslog"},{"id":"7a0869ad-2583-4b25-9499-0830892dcccf","namespaces":["default"],"title":"kibana_syslog*","typeMeta":{},"name":"kibana_syslog"},{"id":"298c0184-0251-4412-a434-84918a292643","namespaces":["default"],"title":"elasticsearch_syslog*","typeMeta":{},"name":"elasticsearch_syslog"},{"id":"75aa5394-b7a2-424c-96d7-d569800d09cc","namespaces":["default"],"title":"jenkins_joblog*","typeMeta":{},"name":"jenkins_joblog*"},{"id":"69199184-a9ab-4b44-b8ce-6e7c7db1501f","namespaces":["default"],"title":"sonarqube_syslog*","typeMeta":{},"name":"sonarqube_syslog"},{"id":"06af65d6-cd2c-459a-8a77-c4ff2f60d42c","namespaces":["default"],"title":"jenkins_syslog*","typeMeta":{},"name":"jenkins_syslog"},{"id":"56dbf731-cccd-4a78-bd8a-8d49e90f6a99","namespaces":["default"],"title":"nexus_syslog*","typeMeta":{},"name":"nexus_syslog"},{"id":"e178641f-067c-41df-a840-645775e3f98d","namespaces":["default"],"title":"maven_syslog*","typeMeta":{},"name":"maven_syslog"},{"id":"0469b0fd-e249-46a7-a638-20aa0857a2ac","namespaces":["default"],"title":"zabbix_syslog*","typeMeta":{},"name":"zabbix_syslog"},{"id":"10fe9c1f-21b8-4e4e-a426-891e4d3b7f10","namespaces":["default"],"title":"filebeat-*","typeMeta":{},"name":"filebeat-windows"},{"id":"892c3ea7-6e1a-4247-8bfb-0a1b20d5c36d","namespaces":["default"],"title":"tomee_passport*","typeMeta":{},"name":"tomee_passport"},{"id":"264e7b91-7ecc-4ee8-8875-f2ef07f812a4","namespaces":["default"],"title":"access_space*","typeMeta":{},"name":"access_space"},{"id":"0a8728be-ecda-4683-9e6d-20e8490622d2","namespaces":["default"],"title":"tomee_space*","typeMeta":{},"name":"tomee_space"},{"id":"ce214701-508c-46dd-ac52-f5cff811a53b","namespaces":["default"],"title":"access_passport*","typeMeta":{},"name":"access_passport"},{"id":"fd9b2e79-f1f0-430d-953a-5d9f8d0afd81","namespaces":["default"],"title":"3dxp_apachetrace*","typeMeta":{},"name":"3dxp_apachetrace"},{"id":"65922670-4a22-491c-85fd-ff45a7681ea3","namespaces":["default"],"title":"3dxp_passportservice*","typeMeta":{},"name":"3dxp_passportservice"},{"id":"41544246-f579-4b38-8170-b98383bde48f","namespaces":["default"],"title":"3dxp_servicetrace*","typeMeta":{},"name":"3dxp_servicetrace"},{"id":"43410484-d055-4899-bd5b-eb917c4af12e","namespaces":["default"],"title":"3dxp_apachetrace*,3dxp_servicetrace*","typeMeta":{},"name":"3dxp_traceability"}]}

I want to fetch a specific data view 3dxp_servicetrace

There's no reference to kibana in the URL path in the docs, I would remove that.

Okay , which command can i use to retrieve a specific data view?

i have used /kibana in the path because i have set up kibana to be accessed with subpath in kibana.yml
server.basepath="/kibana"

If i replace the name of the data view with the id of the data view that i fetched from the output of the command
curl -X GET "localhost:5601/kibana/api/data_views" -H 'kbn-xsrf: true'
I am getting the output correctly.
Is it possible to do the same with the data view name?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.