Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Config for Elasticsearch datasource #89

Closed
kagarlickij opened this issue Aug 20, 2018 · 3 comments
Closed

Config for Elasticsearch datasource #89

kagarlickij opened this issue Aug 20, 2018 · 3 comments

Comments

@kagarlickij
Copy link

Please advice how to configure grafana_datasources for Elasticsearch,
I have to add URL and index, no auth is required, example of config in UI: http://prntscr.com/kkxb4q

@paulfantom
Copy link
Member

We are following standards set by grafana project. So this: http://docs.grafana.org/features/datasources/elasticsearch/#configure-the-datasource-with-provisioning should easily translate to this:

grafana_datasources: []
# - name: "Prometheus"
# type: "prometheus"
# access: "proxy"
# url: "http://prometheus.mydomain"
# basicAuth: true
# basicAuthUser: "admin"
# basicAuthPassword: "password"
# isDefault: true
# jsonData: '{"tlsAuth":false,"tlsAuthWithCACert":false,"tlsSkipVerify":true}'

@kagarlickij
Copy link
Author

To manage this config I set datasource manually and get config from WEB API:
curl -H "Authorization: Bearer eyJ...X0=" http://34.xx.yy.19:3000/api/datasources/name/elasticsearch, it looked like:

{
  "id": 1,
  "orgId": 1,
  "name": "kag-el1",
  "type": "elasticsearch",
  "typeLogoUrl": "",
  "access": "proxy",
  "url": "https://vpc-kag-el1-sgshjf7eq7mhhyllggkdgynhpu.us-east-1.es.amazonaws.com",
  "password": "",
  "user": "",
  "database": "metricbeat-*",
  "basicAuth": false,
  "basicAuthUser": "",
  "basicAuthPassword": "",
  "withCredentials": false,
  "isDefault": true,
  "jsonData": {
    "esVersion": 56,
    "keepCookies": [],
    "maxConcurrentShardRequests": 256,
    "timeField": "@timestamp"
  },
  "secureJsonFields": {},
  "version": 3,
  "readOnly": true
}

Based on it and link @paulfantom provided above I've set config to use with Ansible:

    grafana_datasources:
    - name: elasticsearch
      type: elasticsearch
      access: proxy
      url: "https://vpc-kag-el1-sgshjf7eq7mhhyllggkdgynhpu.us-east-1.es.amazonaws.com"
      basicAuth: false
      database: "metricbeat-*"
      isDefault: true
      jsonData:
        esVersion: 56
        maxConcurrentShardRequests: 256
        timeField: "@timestamp"

Hope it will help somebody)

@lock
Copy link

lock bot commented Mar 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Mar 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants