Generating an API key for MI Log Collector

Programmatic access to Elasticsearch from MI Log Collector (Filebeat) on each MI node is secured using an API key.

  1. On your Elasticsearch server, open the Kibana web application in a browser (http://localhost:5601) and log in using the elastic user credentials.
  2. Open the main menu, scroll down and click Management, then under the Security heading, click API keys.
  3. Click Create API key.
  4. Specify a key name, for example, fb_api.
  5. Select Restrict Privileges then remove the sample JSON and replace it with this:
    { 
      "filebeat": { 
        "cluster": [ 
          "manage_ilm", 
          "manage_index_templates",
          "monitor"
        ], 
        "indices": [ 
          { 
            "names": [ 
              "mi-log*" 
            ], 
            "privileges": [ 
              "all" 
            ] 
          } 
        ] 
      } 
    }
  6. Click Create API Key.
  7. Copy the API key information in Beats format and paste this into a text editor. This is the format required for adding the API key to Filebeat on each MI node in the cluster.