包规范

编辑

集成是一种类型的包,因此必须遵守 Elastic 包规范。包规范描述了

  • 包的文件夹结构以及这些文件夹中预期的文件
  • 预期文件内容的结构

资源组织

编辑

通常,包中的资源按 <elastic-stack-component>/<asset-type> 组织。例如,摄取管道存储在 elasticsearch/ingest-pipeline 文件夹中。此逻辑适用于所有 Elasticsearch、Kibana 和 Agent 资源。

顶级资源会被作为 JSON 文档提取并推送到相应的 Elasticsearch 和 Kibana API。

数据流

编辑

有一个名为 data_stream 的特定文件夹。每个数据流都应该在此文件夹中拥有其资源文件夹,并且这些数据流的名称必须遵循数据流命名方案。

这些文件夹的内容遵循 <elastic-stack-component>/<asset-type> 结构。在安装过程中,Fleet 会强制执行数据流命名规则。此文件夹中的所有资源都直接或间接属于数据流。

在大多数情况下,只需要数据流资源。但是,在需要更多灵活性的情况下,也有一些例外情况。例如,应用于所有数据流的 ILM 策略。

支持的资源

编辑

Elastic 包中通常包含以下资源:

  • Elasticsearch

    • 摄取管道
    • 索引模板
    • 转换
    • 索引模板设置
  • Kibana

    • 仪表盘
    • 可视化
    • 数据视图
    • ML 模块
    • 地图
    • 搜索
    • 安全规则
  • 其他

    • fields.yml

目录结构

编辑
apache
│   changelog.yml
│   manifest.yml
└───_dev
└───data_stream
└───docs
└───img
└───kibana

规范

编辑

包含自包规范存储库。规范更新时,此内容也会更新。

##
## Entrypoint of "integration packages" specification.
##
## Describes the folders and files that make up a package.
##
spec:
  additionalContents: true
  totalContentsLimit: 65535
  totalSizeLimit: 250MB
  sizeLimit: 150MB
  configurationSizeLimit: 5MB
  relativePathSizeLimit: 3MB
  fieldsPerDataStreamLimit: 2048
  contents:
  - description: The main package manifest file
    type: file
    contentMediaType: "application/x-yaml"
    sizeLimit: 5MB
    name: "manifest.yml"
    required: true
    $ref: "./manifest.spec.yml"
  - description: The package's CHANGELOG file
    type: file
    contentMediaType: "application/x-yaml"
    name: "changelog.yml"
    required: true
    $ref: "./changelog.spec.yml"
  - description: The package's NOTICE file
    type: file
    contentMediaType: "text/plain"
    name: "NOTICE.txt"
    required: false
  - description: The package's license file
    type: file
    contentMediaType: "text/plain"
    name: "LICENSE.txt"
    required: false
  - description: Folder containing data stream definitions
    type: folder
    name: data_stream
    required: false
    $ref: "./data_stream/spec.yml"
  - description: Folder containing documentation for the package
    type: folder
    name: docs
    required: true
    $ref: "./docs/spec.yml"
  - description: Folder containing agent-related definitions
    type: folder
    name: agent
    required: false
    $ref: "./agent/spec.yml"
  - description: Folder containing Kibana assets used by the package
    type: folder
    name: kibana
    required: false
    $ref: "./kibana/spec.yml"
  - description: Folder containing development resources
    type: folder
    name: _dev
    required: false
    visibility: private
    $ref: "./_dev/spec.yml"
  - description: Folder containing Elasticsearch assets used by the package
    type: folder
    name: elasticsearch
    required: false
    $ref: "./elasticsearch/spec.yml"
  - description: Configuration file to process the results returned from the package validation. This file is just for package validation and it should be ignored when installing or using the package.
    type: file
    contentMediaType: "application/x-yaml"
    name: "validation.yml"
    required: false
    $ref: "./validation.spec.yml"
  - description: Folder containing images for the package
    type: folder
    name: img
    required: false
    $ref: "./img/spec.yml"

versions:
  - before: 3.2.2
    patch:
      - op: remove
        path: "/contents/11" # Definition for img folder.