1. 新建workspace

kibana

在这里插入图片描述
在这里插入图片描述

curl

curl --location --request POST 'http://localhost:5601/api/spaces/space' \
--header 'kbn-xsrf: true' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "test",
    "id": "test",
    "description": "测试",
    "disabledFeatures": [
        "discover",
        "visualize",
        "dev_tools",
        "advancedSettings",
        "indexPatterns",
        "savedObjectsManagement",
        "graph",
        "monitoring",
        "ml",
        "apm",
        "maps",
        "canvas",
        "infrastructure",
        "logs",
        "siem",
        "uptime"
    ]
}'

其中disabledFeatures即在该工作区不显示功能。

2. 新建角色

kibana

在这里插入图片描述

curl

curl --location --request PUT 'http://localhost:5601/api/security/role/test' \
--header 'kbn-xsrf: true' \
--header 'Content-Type: application/json' \
--data-raw '{
    "elasticsearch": {
        "cluster": [
            "all"
        ],
        "indices": [
            {
                "names": [
                    "*"
                ],
                "privileges": [
                    "read"
                ],
                "field_security": {
                    "grant": [
                        "*"
                    ],
                    "except": []
                }
            }
        ],
        "run_as": []
    },
    "kibana": [
        {
            "spaces": [
                "test"
            ],
            "base": [],
            "feature": {
                "dashboard": [
                    "read"
                ]
            }
        }
    ]
}'

3. 新建用户

kibana

在这里插入图片描述

curl

curl --location --request POST 'http://localhost:5601/internal/security/users/test' \
--header 'kbn-xsrf: true' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "",
    "username": "test",
    "full_name": "测试",
    "roles": [
        "frontend"
    ],
    "enabled": true,
    "password": "testtest"
}'

导入dashboard

kibana

curl

POST http://localhoat:5601/s/frontend/api/saved_objects/_import?overwrite=true
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐