output-index.asciidoc 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. [role="xpack"]
  2. [[audit-index]]
  3. === Index audit output
  4. In addition to logging to a file, you can store audit logs in Elasticsearch
  5. rolling indices. These indices can be either on the same cluster, or on a
  6. remote cluster. You configure the following settings in
  7. `elasticsearch.yml` to control how audit entries are indexed. To enable
  8. this output, you need to configure the setting `xpack.security.audit.outputs`
  9. in the `elasticsearch.yml` file:
  10. [source,yaml]
  11. ----------------------------
  12. xpack.security.audit.outputs: [ index, logfile ]
  13. ----------------------------
  14. For more configuration options, see
  15. {ref}/auditing-settings.html#index-audit-settings[Audit log indexing configuration settings].
  16. IMPORTANT: No filtering is performed when auditing, so sensitive data may be
  17. audited in plain text when including the request body in audit events.
  18. [float]
  19. ==== Audit index settings
  20. You can also configure settings for the indices that the events are stored in.
  21. These settings are configured in the `xpack.security.audit.index.settings` namespace
  22. in `elasticsearch.yml`. For example, the following configuration sets the
  23. number of shards and replicas to 1 for the audit indices:
  24. [source,yaml]
  25. ----------------------------
  26. xpack.security.audit.index.settings:
  27. index:
  28. number_of_shards: 1
  29. number_of_replicas: 1
  30. ----------------------------
  31. These settings apply to the local audit indices, as well as to the
  32. <<forwarding-audit-logfiles, remote audit indices>>, but only if the remote cluster
  33. does *not* have {security-features} enabled or the {es} versions are different.
  34. If the remote cluster has {security-features} enabled and the versions coincide,
  35. the settings for the audit indices there will take precedence,
  36. even if they are unspecified (i.e. left to defaults).
  37. NOTE: Audit events are batched for indexing so there is a lag before
  38. events appear in the index. You can control how frequently batches of
  39. events are pushed to the index by setting
  40. `xpack.security.audit.index.flush_interval` in `elasticsearch.yml`.