一、配置
1. 修改kibana.yml配置文件
vi /config/kibana.yml
追加以下內容:
xpack.security.authc.providers:
basic.basic1:
order: 0
anonymous.anonymous1:
order: 1
credentials:
username: "anonymous"
password: "anonymous"
2. 新增匿名用戶和角色
新增匿名用戶和角色,並將二者關聯
二、頁面集成
1. iframe
嵌套(適用於Dashboards)
- Open the main menu, then click Dashboard or Visualize Library.
- Open the dashboard or visualization you want to embed.
- To generate the HTML code snippet, open the Share menu, then click Embed code > Copy iFrame code.
You can embed this snippet in your web page, and then add analysis, images, and links to give more context to the object you’re sharing.
<iframe src="https://localhost:5601/app/monitoring?auth_provider_hint=anonymous1#/elasticsearch/nodes?embed=true&_g=(....)" height="600" width="800"></iframe>
2.直接調整至鏈接(適用於日誌流)
http://localhost:5601/app/logs/stream?flyoutOptions=(flyoutId:!n,flyoutVisibility:hidden,surroundingLogsId:!n)
三、匿名訪問
1. 直接以匿名用戶方式訪問
http://localhost:5601/app/logs/stream?auth_provider_hint=anonymous1&flyoutOptions=(flyoutId:!n,flyoutVisibility:hidden,surroundingLogsId:!n)
2. 由用戶選擇是否採用匿名方式訪問
http://localhost:5601/app/logs/stream?flyoutOptions=(flyoutId:!n,flyoutVisibility:hidden,surroundingLogsId:!n)