Graylog Rest API整理

接口地址

安装graylog以后在System/Notes中查看API
集群版本查看Cluster Global API browser即可,单机版查看具体节点列表中的API browser
image.png

进入接口文档后,可直接调用调试
image.png

对接方式

📢注意:
接口文档也不一定清晰,这时可以直接在web接口查看对应的接口入参等信息。

接口文档

以下是开发过程中整理的接口文档,希望对大家有帮助

接口文档地址:https://console-docs.apipost.cn/preview/3f6d9ac605953486/ef00e23523434c94

/graylog

graylog api
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/Search

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/Search/Prometheus监控接口

暂无描述
接口状态

开发中

接口URL

http://10.9.24.23:9833/api/metrics/prometheus

请求方式

GET

Content-Type

none

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/Search/01 创建查询

暂无描述
接口状态

开发中

接口URL

127.0.0.1:29000/api/views/search

请求方式

POST

Content-Type

json

请求Body参数
{
  "queries": [
    {
      "query": {
        "type": "elasticsearch",
        "query_string": "env:dev AND level_name:INFO"
      },
      "timerange": {
        "type": "relative",
        "from": 300
      },
      "filter": {
        "type": "or",
        "filters": [
          {
            "type": "stream",
            "id": "62f6165c3e8f9b4314589b8b"
          }
        ]
      },
      "search_types": [
        {
          "timerange": null,
          "query": null,
          "streams": [],
          "name": "chart",
          "series": [
            {
              "type": "count",
              "id": "count()",
              "field": null
            }
          ],
          "sort": [],
          "rollup": true,
          "type": "pivot",
          "row_groups": [
            {
              "type": "time",
              "field": "timestamp",
              "interval": {
                "type": "auto",
                "scaling": 1
              }
            }
          ],
          "column_groups": [],
          "filter": null
        },
        {
          "timerange": null,
          "query": null,
          "streams": [],
          "name": null,
          "limit": 150,
          "offset": 0,
          "sort": [
            {
              "field": "timestamp",
              "order": "DESC"
            }
          ],
          "decorators": [],
          "type": "messages",
          "filter": null
        }
      ]
    }
  ],
  "parameters": []
}
参数名示例值参数类型是否必填参数描述
queries-Object-
queries.query-Object检索条件
queries.query.typeelasticsearchString固定值
queries.query.query_stringenv:dev AND level_name:INFOString-
queries.timerange-Object时间范围,有相对时间和绝对时间。后续封装api直接使用绝对时间即可
queries.timerange.typerelativeStringrelative absolute
queries.timerange.from300Integer选择absolute时,时间有form和to,都是字符串格式。UTC时间格式
queries.filter-Object指定stream,全局检索时为null即可
queries.filter.typeorString-
queries.filter.filters-Object可以为多个filter
queries.filter.filters.typestreamString-
queries.filter.filters.id62f6165c3e8f9b4314589b8bString-
queries.search_types-Object-
queries.search_types.timerangenullNull-
queries.search_types.querynullNull-
queries.search_types.streams-Object-
queries.search_types.namechartString-
queries.search_types.series-Object-
queries.search_types.series.typecountString-
queries.search_types.series.idcount()String-
queries.search_types.series.fieldnullNull-
queries.search_types.sort-Object-
queries.search_types.rolluptrueBoolean-
queries.search_types.typepivotString-
queries.search_types.row_groups-Object-
queries.search_types.row_groups.typetimeString-
queries.search_types.row_groups.fieldtimestampString-
queries.search_types.row_groups.interval-Object-
queries.search_types.row_groups.interval.typeautoString-
queries.search_types.row_groups.interval.scaling1Integer-
queries.search_types.column_groups-Object-
queries.search_types.filternullNull-
parameters-Object-
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
    "id": "632d473883ac345b777826c3",
    "queries": [
        {
            "id": "390e5b12-5d23-45da-817f-4151fa618cde",
            "timerange": {
                "type": "relative",
                "from": 300
            },
            "filter": {
                "type": "or",
                "filters": [
                    {
                        "type": "stream",
                        "id": "62f6165c3e8f9b4314589b8b"
                    }
                ]
            },
            "query": {
                "type": "elasticsearch",
                "query_string": "env:dev AND level_name:INFO"
            },
            "search_types": [
                {
                    "timerange": null,
                    "query": null,
                    "streams": [],
                    "id": "6e15503e-b21d-4152-acdc-eac03399f8c5",
                    "name": null,
                    "limit": 150,
                    "offset": 0,
                    "sort": [
                        {
                            "field": "timestamp",
                            "order": "DESC"
                        }
                    ],
                    "decorators": [],
                    "type": "messages",
                    "filter": null
                },
                {
                    "timerange": null,
                    "query": null,
                    "streams": [],
                    "id": "aff8ddd5-a506-4cbd-903e-ad1b8d3a9b45",
                    "name": "chart",
                    "series": [
                        {
                            "type": "count",
                            "id": "count()",
                            "field": null
                        }
                    ],
                    "sort": [],
                    "rollup": true,
                    "type": "pivot",
                    "row_groups": [
                        {
                            "type": "time",
                            "field": "timestamp",
                            "interval": {
                                "type": "auto",
                                "scaling": 1.0
                            }
                        }
                    ],
                    "column_groups": [],
                    "filter": null
                }
            ]
        }
    ],
    "parameters": [],
    "requires": {},
    "owner": "admin",
    "created_at": "2022-09-23T05:42:16.209Z"
}
参数名示例值参数类型参数描述
id632d473883ac345b777826c3String搜索ID,用于检索消息
queries-Object
queries.id390e5b12-5d23-45da-817f-4151fa618cdeString
queries.timerange-Object时间范围,有相对时间和绝对时间。后续封装api直接使用绝对时间即可
queries.timerange.typerelativeStringrelative absolute
queries.timerange.from300Integer选择absolute时,时间有form和to,都是字符串格式。
queries.filter-Object指定stream,全局检索时为null即可
queries.filter.typeorString
queries.filter.filters-Object可以为多个filter
queries.filter.filters.typestreamString
queries.filter.filters.id62f6165c3e8f9b4314589b8bString
queries.query-Object检索条件
queries.query.typeelasticsearchString固定值
queries.query.query_stringenv:dev AND level_name:INFOString
queries.search_types-Object
queries.search_types.timerangenullNull
queries.search_types.querynullNull
queries.search_types.streams-Object
queries.search_types.id6e15503e-b21d-4152-acdc-eac03399f8c5String
queries.search_types.namenullNull
queries.search_types.limit150Integer
queries.search_types.offset0Integer
queries.search_types.sort-Object
queries.search_types.sort.fieldtimestampString
queries.search_types.sort.orderDESCString
queries.search_types.decorators-Object
queries.search_types.typemessagesString
queries.search_types.filternullNull
parameters-Object
requires-Object
owneradminString
created_at2022-09-23T05:42:16.209ZString

/graylog/Search/02 搜索日志

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/views/search/:queryId/execute

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
queryId632d473883ac345b777826c3创建查询时返回的ID
请求Body参数
{
	"parameter_bindings": {}
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/Search/03 查询构建的查询

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/views/search

请求方式

GET

Content-Type

json

请求Body参数

参数名示例值参数类型是否必填参数描述
queries-Object-
queries.query-Object检索条件
queries.query.typeelasticsearchString固定值
queries.query.query_stringenv:dev AND level_name:INFOString-
queries.timerange-Object时间范围,有相对时间和绝对时间。后续封装api直接使用绝对时间即可
queries.timerange.typerelativeStringrelative absolute
queries.timerange.from300Integer选择absolute时,时间有form和to,都是字符串格式。UTC时间格式
queries.filter-Object指定stream,全局检索时为null即可
queries.filter.typeorString-
queries.filter.filters-Object可以为多个filter
queries.filter.filters.typestreamString-
queries.filter.filters.id62f6165c3e8f9b4314589b8bString-
queries.search_types-Object-
queries.search_types.timerangenullNull-
queries.search_types.querynullNull-
queries.search_types.streams-Object-
queries.search_types.namechartString-
queries.search_types.series-Object-
queries.search_types.series.typecountString-
queries.search_types.series.idcount()String-
queries.search_types.series.fieldnullNull-
queries.search_types.sort-Object-
queries.search_types.rolluptrueBoolean-
queries.search_types.typepivotString-
queries.search_types.row_groups-Object-
queries.search_types.row_groups.typetimeString-
queries.search_types.row_groups.fieldtimestampString-
queries.search_types.row_groups.interval-Object-
queries.search_types.row_groups.interval.typeautoString-
queries.search_types.row_groups.interval.scaling1Integer-
queries.search_types.column_groups-Object-
queries.search_types.filternullNull-
parameters-Object-
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
    "id": "632d473883ac345b777826c3",
    "queries": [
        {
            "id": "390e5b12-5d23-45da-817f-4151fa618cde",
            "timerange": {
                "type": "relative",
                "from": 300
            },
            "filter": {
                "type": "or",
                "filters": [
                    {
                        "type": "stream",
                        "id": "62f6165c3e8f9b4314589b8b"
                    }
                ]
            },
            "query": {
                "type": "elasticsearch",
                "query_string": "env:dev AND level_name:INFO"
            },
            "search_types": [
                {
                    "timerange": null,
                    "query": null,
                    "streams": [],
                    "id": "6e15503e-b21d-4152-acdc-eac03399f8c5",
                    "name": null,
                    "limit": 150,
                    "offset": 0,
                    "sort": [
                        {
                            "field": "timestamp",
                            "order": "DESC"
                        }
                    ],
                    "decorators": [],
                    "type": "messages",
                    "filter": null
                },
                {
                    "timerange": null,
                    "query": null,
                    "streams": [],
                    "id": "aff8ddd5-a506-4cbd-903e-ad1b8d3a9b45",
                    "name": "chart",
                    "series": [
                        {
                            "type": "count",
                            "id": "count()",
                            "field": null
                        }
                    ],
                    "sort": [],
                    "rollup": true,
                    "type": "pivot",
                    "row_groups": [
                        {
                            "type": "time",
                            "field": "timestamp",
                            "interval": {
                                "type": "auto",
                                "scaling": 1.0
                            }
                        }
                    ],
                    "column_groups": [],
                    "filter": null
                }
            ]
        }
    ],
    "parameters": [],
    "requires": {},
    "owner": "admin",
    "created_at": "2022-09-23T05:42:16.209Z"
}
参数名示例值参数类型参数描述
id632d473883ac345b777826c3String搜索ID,用于检索消息
queries-Object
queries.id390e5b12-5d23-45da-817f-4151fa618cdeString
queries.timerange-Object时间范围,有相对时间和绝对时间。后续封装api直接使用绝对时间即可
queries.timerange.typerelativeStringrelative absolute
queries.timerange.from300Integer选择absolute时,时间有form和to,都是字符串格式。
queries.filter-Object指定stream,全局检索时为null即可
queries.filter.typeorString
queries.filter.filters-Object可以为多个filter
queries.filter.filters.typestreamString
queries.filter.filters.id62f6165c3e8f9b4314589b8bString
queries.query-Object检索条件
queries.query.typeelasticsearchString固定值
queries.query.query_stringenv:dev AND level_name:INFOString
queries.search_types-Object
queries.search_types.timerangenullNull
queries.search_types.querynullNull
queries.search_types.streams-Object
queries.search_types.id6e15503e-b21d-4152-acdc-eac03399f8c5String
queries.search_types.namenullNull
queries.search_types.limit150Integer
queries.search_types.offset0Integer
queries.search_types.sort-Object
queries.search_types.sort.fieldtimestampString
queries.search_types.sort.orderDESCString
queries.search_types.decorators-Object
queries.search_types.typemessagesString
queries.search_types.filternullNull
parameters-Object
requires-Object
owneradminString
created_at2022-09-23T05:42:16.209ZString

/graylog/Streams

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/Streams/01 获取所有的Streams

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams

请求方式

GET

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"total": 6,
	"streams": [
		{
			"id": "62f6165c3e8f9b4314589b8b",
			"creator_user_id": "admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "运维开发环境Stream",
			"created_at": "2022-08-12T08:59:08.477Z",
			"disabled": false,
			"rules": [
				{
					"field": "env",
					"stream_id": "62f6165c3e8f9b4314589b8b",
					"description": "",
					"id": "6311c8533673d47ac03b5ea5",
					"type": 1,
					"inverted": false,
					"value": "dev"
				},
				{
					"field": "app_name",
					"stream_id": "62f6165c3e8f9b4314589b8b",
					"description": "",
					"id": "6311c8643673d47ac03b5ebd",
					"type": 1,
					"inverted": false,
					"value": "gdmp"
				}
			],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "gdmp_dev",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "6305e74923481c2cd7551bfa",
			"is_editable": true,
			"is_default": false
		},
		{
			"id": "000000000000000000000001",
			"creator_user_id": "local:admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "Stream containing all messages",
			"created_at": "2022-08-05T06:50:59.889Z",
			"disabled": false,
			"rules": [],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "All messages",
			"content_pack": null,
			"remove_matches_from_default_stream": false,
			"index_set_id": "62ecbdd39ec96a0baedb250e",
			"is_editable": true,
			"is_default": true
		},
		{
			"id": "63154c2183ac345b775d3b0c",
			"creator_user_id": "admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "运维测试环境Stream",
			"created_at": "2022-09-05T01:08:49.513Z",
			"disabled": false,
			"rules": [
				{
					"field": "env",
					"stream_id": "63154c2183ac345b775d3b0c",
					"description": "",
					"id": "6315aebe83ac345b775df447",
					"type": 1,
					"inverted": false,
					"value": "test"
				},
				{
					"field": "app_name",
					"stream_id": "63154c2183ac345b775d3b0c",
					"description": "",
					"id": "6315af1583ac345b775df4bd",
					"type": 1,
					"inverted": false,
					"value": "gdmp"
				}
			],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "gdmp_test",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "6305e74923481c2cd7551bfa",
			"is_editable": true,
			"is_default": false
		},
		{
			"id": "000000000000000000000002",
			"creator_user_id": "admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "Stream containing all events created by Graylog",
			"created_at": "2022-08-05T06:51:03.060Z",
			"disabled": false,
			"rules": [],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "All events",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "62ecbdd79ec96a0baedb2595",
			"is_editable": false,
			"is_default": false
		},
		{
			"id": "000000000000000000000003",
			"creator_user_id": "admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "Stream containing all system events created by Graylog",
			"created_at": "2022-08-05T06:51:03.067Z",
			"disabled": false,
			"rules": [],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "All system events",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "62ecbdd79ec96a0baedb2597",
			"is_editable": false,
			"is_default": false
		},
		{
			"id": "62f615de3e8f9b4314589ad4",
			"creator_user_id": "admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "运维本地环境Stream",
			"created_at": "2022-08-12T08:57:02.629Z",
			"disabled": false,
			"rules": [
				{
					"field": "env",
					"stream_id": "62f615de3e8f9b4314589ad4",
					"description": "",
					"id": "6311c78e3673d47ac03b5da9",
					"type": 6,
					"inverted": false,
					"value": "local"
				},
				{
					"field": "app_name",
					"stream_id": "62f615de3e8f9b4314589ad4",
					"description": "",
					"id": "6311c7e53673d47ac03b5e19",
					"type": 6,
					"inverted": false,
					"value": "gdmp"
				}
			],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "gdmp_local",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "6305e74923481c2cd7551bfa",
			"is_editable": true,
			"is_default": false
		}
	]
}

/graylog/Streams/02 获取单个的Stream

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:id

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
id62f615de3e8f9b4314589ad4streamID
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"id": "62f615de3e8f9b4314589ad4",
	"creator_user_id": "admin",
	"outputs": [],
	"matching_type": "AND",
	"description": "运维本地环境Stream",
	"created_at": "2022-08-12T08:57:02.629Z",
	"disabled": false,
	"rules": [
		{
			"field": "env",
			"stream_id": "62f615de3e8f9b4314589ad4",
			"description": "",
			"id": "6311c78e3673d47ac03b5da9",
			"type": 6,
			"inverted": false,
			"value": "local"
		},
		{
			"field": "app_name",
			"stream_id": "62f615de3e8f9b4314589ad4",
			"description": "",
			"id": "6311c7e53673d47ac03b5e19",
			"type": 6,
			"inverted": false,
			"value": "gdmp"
		}
	],
	"alert_conditions": [],
	"alert_receivers": {
		"emails": [],
		"users": []
	},
	"title": "gdmp_local",
	"content_pack": null,
	"remove_matches_from_default_stream": true,
	"index_set_id": "6305e74923481c2cd7551bfa",
	"is_editable": true,
	"is_default": false
}

/graylog/Streams/03 分页获取

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/paginated?page=1&per_page=50&sort=title&order=asc

请求方式

GET

Content-Type

json

请求Query参数
参数名示例值参数类型是否必填参数描述
page1String-
per_page50String-
sorttitleString-
orderascString-
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"query": "",
	"total": 6,
	"sort": "title",
	"order": "asc",
	"streams": [
		{
			"id": "000000000000000000000002",
			"creator_user_id": "admin",
			"outputs": null,
			"matching_type": "AND",
			"description": "Stream containing all events created by Graylog",
			"created_at": "Fri Aug 05 06:51:03 UTC 2022",
			"rules": [],
			"disabled": false,
			"alert_conditions": null,
			"alert_receivers": null,
			"title": "All events",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "62ecbdd79ec96a0baedb2595",
			"is_editable": false,
			"is_default": false
		},
		{
			"id": "000000000000000000000001",
			"creator_user_id": "local:admin",
			"outputs": null,
			"matching_type": "AND",
			"description": "Stream containing all messages",
			"created_at": "Fri Aug 05 06:50:59 UTC 2022",
			"rules": [],
			"disabled": false,
			"alert_conditions": null,
			"alert_receivers": null,
			"title": "All messages",
			"content_pack": null,
			"remove_matches_from_default_stream": false,
			"index_set_id": "62ecbdd39ec96a0baedb250e",
			"is_editable": true,
			"is_default": true
		},
		{
			"id": "000000000000000000000003",
			"creator_user_id": "admin",
			"outputs": null,
			"matching_type": "AND",
			"description": "Stream containing all system events created by Graylog",
			"created_at": "Fri Aug 05 06:51:03 UTC 2022",
			"rules": [],
			"disabled": false,
			"alert_conditions": null,
			"alert_receivers": null,
			"title": "All system events",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "62ecbdd79ec96a0baedb2597",
			"is_editable": false,
			"is_default": false
		},
		{
			"id": "62f6165c3e8f9b4314589b8b",
			"creator_user_id": "admin",
			"outputs": null,
			"matching_type": "AND",
			"description": "运维开发环境Stream",
			"created_at": "Fri Aug 12 08:59:08 UTC 2022",
			"rules": [
				{
					"field": "env",
					"stream_id": "62f6165c3e8f9b4314589b8b",
					"description": "",
					"id": "6311c8533673d47ac03b5ea5",
					"type": 1,
					"inverted": false,
					"value": "dev"
				},
				{
					"field": "app_name",
					"stream_id": "62f6165c3e8f9b4314589b8b",
					"description": "",
					"id": "6311c8643673d47ac03b5ebd",
					"type": 1,
					"inverted": false,
					"value": "gdmp"
				}
			],
			"disabled": false,
			"alert_conditions": null,
			"alert_receivers": null,
			"title": "gdmp_dev",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "6305e74923481c2cd7551bfa",
			"is_editable": true,
			"is_default": false
		},
		{
			"id": "62f615de3e8f9b4314589ad4",
			"creator_user_id": "admin",
			"outputs": null,
			"matching_type": "AND",
			"description": "运维本地环境Stream",
			"created_at": "Fri Aug 12 08:57:02 UTC 2022",
			"rules": [
				{
					"field": "env",
					"stream_id": "62f615de3e8f9b4314589ad4",
					"description": "",
					"id": "6311c78e3673d47ac03b5da9",
					"type": 6,
					"inverted": false,
					"value": "local"
				},
				{
					"field": "app_name",
					"stream_id": "62f615de3e8f9b4314589ad4",
					"description": "",
					"id": "6311c7e53673d47ac03b5e19",
					"type": 6,
					"inverted": false,
					"value": "gdmp"
				}
			],
			"disabled": false,
			"alert_conditions": null,
			"alert_receivers": null,
			"title": "gdmp_local",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "6305e74923481c2cd7551bfa",
			"is_editable": true,
			"is_default": false
		},
		{
			"id": "63154c2183ac345b775d3b0c",
			"creator_user_id": "admin",
			"outputs": null,
			"matching_type": "AND",
			"description": "运维测试环境Stream",
			"created_at": "Mon Sep 05 01:08:49 UTC 2022",
			"rules": [
				{
					"field": "env",
					"stream_id": "63154c2183ac345b775d3b0c",
					"description": "",
					"id": "6315aebe83ac345b775df447",
					"type": 1,
					"inverted": false,
					"value": "test"
				},
				{
					"field": "app_name",
					"stream_id": "63154c2183ac345b775d3b0c",
					"description": "",
					"id": "6315af1583ac345b775df4bd",
					"type": 1,
					"inverted": false,
					"value": "gdmp"
				}
			],
			"disabled": false,
			"alert_conditions": null,
			"alert_receivers": null,
			"title": "gdmp_test",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "6305e74923481c2cd7551bfa",
			"is_editable": true,
			"is_default": false
		}
	],
	"pagination": {
		"total": 6,
		"count": 6,
		"page": 1,
		"per_page": 50
	}
}

/graylog/Streams/04 获取启用的Stream

添加stream后,默认是停用状态
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/enabled

请求方式

GET

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"total": 6,
	"streams": [
		{
			"id": "62f6165c3e8f9b4314589b8b",
			"creator_user_id": "admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "运维开发环境Stream",
			"created_at": "2022-08-12T08:59:08.477Z",
			"disabled": false,
			"rules": [
				{
					"field": "env",
					"stream_id": "62f6165c3e8f9b4314589b8b",
					"description": "",
					"id": "6311c8533673d47ac03b5ea5",
					"type": 1,
					"inverted": false,
					"value": "dev"
				},
				{
					"field": "app_name",
					"stream_id": "62f6165c3e8f9b4314589b8b",
					"description": "",
					"id": "6311c8643673d47ac03b5ebd",
					"type": 1,
					"inverted": false,
					"value": "gdmp"
				}
			],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "gdmp_dev",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "6305e74923481c2cd7551bfa",
			"is_editable": true,
			"is_default": false
		},
		{
			"id": "000000000000000000000001",
			"creator_user_id": "local:admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "Stream containing all messages",
			"created_at": "2022-08-05T06:50:59.889Z",
			"disabled": false,
			"rules": [],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "All messages",
			"content_pack": null,
			"remove_matches_from_default_stream": false,
			"index_set_id": "62ecbdd39ec96a0baedb250e",
			"is_editable": true,
			"is_default": true
		},
		{
			"id": "63154c2183ac345b775d3b0c",
			"creator_user_id": "admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "运维测试环境Stream",
			"created_at": "2022-09-05T01:08:49.513Z",
			"disabled": false,
			"rules": [
				{
					"field": "env",
					"stream_id": "63154c2183ac345b775d3b0c",
					"description": "",
					"id": "6315aebe83ac345b775df447",
					"type": 1,
					"inverted": false,
					"value": "test"
				},
				{
					"field": "app_name",
					"stream_id": "63154c2183ac345b775d3b0c",
					"description": "",
					"id": "6315af1583ac345b775df4bd",
					"type": 1,
					"inverted": false,
					"value": "gdmp"
				}
			],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "gdmp_test",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "6305e74923481c2cd7551bfa",
			"is_editable": true,
			"is_default": false
		},
		{
			"id": "000000000000000000000002",
			"creator_user_id": "admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "Stream containing all events created by Graylog",
			"created_at": "2022-08-05T06:51:03.060Z",
			"disabled": false,
			"rules": [],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "All events",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "62ecbdd79ec96a0baedb2595",
			"is_editable": false,
			"is_default": false
		},
		{
			"id": "000000000000000000000003",
			"creator_user_id": "admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "Stream containing all system events created by Graylog",
			"created_at": "2022-08-05T06:51:03.067Z",
			"disabled": false,
			"rules": [],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "All system events",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "62ecbdd79ec96a0baedb2597",
			"is_editable": false,
			"is_default": false
		},
		{
			"id": "62f615de3e8f9b4314589ad4",
			"creator_user_id": "admin",
			"outputs": [],
			"matching_type": "AND",
			"description": "运维本地环境Stream",
			"created_at": "2022-08-12T08:57:02.629Z",
			"disabled": false,
			"rules": [
				{
					"field": "env",
					"stream_id": "62f615de3e8f9b4314589ad4",
					"description": "",
					"id": "6311c78e3673d47ac03b5da9",
					"type": 6,
					"inverted": false,
					"value": "local"
				},
				{
					"field": "app_name",
					"stream_id": "62f615de3e8f9b4314589ad4",
					"description": "",
					"id": "6311c7e53673d47ac03b5e19",
					"type": 6,
					"inverted": false,
					"value": "gdmp"
				}
			],
			"alert_conditions": [],
			"alert_receivers": {
				"emails": [],
				"users": []
			},
			"title": "gdmp_local",
			"content_pack": null,
			"remove_matches_from_default_stream": true,
			"index_set_id": "6305e74923481c2cd7551bfa",
			"is_editable": true,
			"is_default": false
		}
	]
}

/graylog/Streams/05 创建Stream

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams

请求方式

POST

Content-Type

json

请求Body参数
{
  "index_set_id": "632aa5ea83ac345b77753f73",
  "remove_matches_from_default_stream": true,
  "matching_type": "AND",
  "description": "描述信息",
  "rules": [
    {
      "field": "env",
      "description": "字段描述【env为环境】",
      "inverted": false,
      "type": 6,
      "value": "pro"
    },
    {
      "field": "app_name",
      "description": "字段描述【app_name为应用服务名称】",
      "inverted": false,
      "type": 6,
      "value": "gdmp"
    }
  ],
  "title": "stream测试555",
  "content_pack": null
}
参数名示例值参数类型是否必填参数描述
index_set_id632aa5ea83ac345b77753f73String索引ID
remove_matches_from_default_streamtrueBoolean取消默认匹配
matching_typeANDStringAND/OR。用于判断rules规则关系
description描述信息String描述信息
rules-Object规则,用于将inputs的数据分类
rules.fieldenvString字段编码
rules.description字段描述【env为环境】String描述信息
rules.invertedfalseBooleanTODO 还不知道啥意思
rules.typeintegerStringTODO 类型 不知道是啥意思 默认为6
rules.valuestringString字段值
titlestream名称String名称
content_packstringStringTODO 不清楚干啥的
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
  "stream_id": "632ac7ea83ac345b7775653c"
}

/graylog/Streams/06 更新Stream

**注意:新增接口中的规则不能更新。**
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId

请求方式

PUT

Content-Type

json

路径变量
参数名示例值参数描述
streamId632ad29383ac345b7775714a-
请求Body参数
{
  "index_set_id": "632aa5ea83ac345b77753f73",
  "remove_matches_from_default_stream": true,
  "matching_type": "AND",
  "description": "描述信息444",
  "title": "stream测试333"
}
参数名示例值参数类型是否必填参数描述
index_set_id632aa5ea83ac345b77753f73String索引ID
remove_matches_from_default_streamtrueBoolean取消默认匹配,对应系统【Remove matches from ‘All messages’ stream】
matching_typeANDStringAND/OR。用于判断rules规则关系
description描述信息444String描述信息
titlestream测试333String名称
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
无返回数据

/graylog/Streams/07 删除Stream

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId

请求方式

DELETE

Content-Type

json

路径变量
参数名示例值参数描述
streamId632ad29383ac345b7775714astreamID
请求Body参数

参数名示例值参数类型是否必填参数描述
index_set_id632aa5ea83ac345b77753f73String索引ID
remove_matches_from_default_streamtrueBoolean取消默认匹配,对应系统【Remove matches from ‘All messages’ stream】
matching_typeANDStringAND/OR。用于判断rules规则关系
description描述信息444String描述信息
titlestream测试333String名称
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
无返回数据
错误响应示例
"message"
"Stream <632acfca83ac345b77756e21> not found!"

/graylog/Streams/08 暂停Stream

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId/pause

请求方式

POST

Content-Type

json

路径变量
参数名示例值参数描述
streamId632ad35083ac345b77757225-
请求Body参数

参数名示例值参数类型是否必填参数描述
index_set_id632aa5ea83ac345b77753f73String索引ID
remove_matches_from_default_streamtrueBoolean取消默认匹配,对应系统【Remove matches from ‘All messages’ stream】
matching_typeANDStringAND/OR。用于判断rules规则关系
description描述信息444String描述信息
titlestream测试333String名称
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
无返回数据 返回状态码为204
错误响应示例
"message"
"Stream <632acfca83ac345b77756e21> not found!"

/graylog/Streams/09 启用Stream

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId/resume

请求方式

POST

Content-Type

json

路径变量
参数名示例值参数描述
streamId632ad35083ac345b77757225-
请求Body参数

参数名示例值参数类型是否必填参数描述
index_set_id632aa5ea83ac345b77753f73String索引ID
remove_matches_from_default_streamtrueBoolean取消默认匹配,对应系统【Remove matches from ‘All messages’ stream】
matching_typeANDStringAND/OR。用于判断rules规则关系
description描述信息444String描述信息
titlestream测试333String名称
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
无返回数据 返回状态码为204
错误响应示例
"message"
"Stream <632acfca83ac345b77756e21> not found!"

/graylog/Streams/10 测试规则匹配

该接口需要添加header 
accept:application/json

`*/*` 不生效
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId/testMatch

请求方式

POST

Content-Type

json

请求Header参数
参数名示例值参数类型是否必填参数描述
acceptapplication/jsonString-
路径变量
参数名示例值参数描述
streamId62f6165c3e8f9b4314589b8b-
请求Body参数
{
  "message": {
    "gl2_accounted_message_size": 421,
    "level": 6,
    "gl2_remote_ip": "10.0.204.66",
    "gl2_remote_port": 47682,
    "streams": [
      "62f6165c3e8f9b4314589b8b"
    ],
    "gl2_message_id": "01GDFMR73G8CFQA1HJ2852Z2BP",
    "source": "host-10-0-204-66",
    "message": "The request path is: /actuator/prometheus",
    "env": "dev",
    "gl2_source_input": "62f0e00d88b7eb6e6a307295",
    "app_name": "gdmp",
    "level_name": "INFO",
    "full_message": "2022-09-21 17:09:21,259 - [http-nio-18090-exec-5] INFO  c.g.g.b.p.servlet.ArgResolverFilter - The request path is: /actuator/prometheus",
    "thread_name": "http-nio-18090-exec-5",
    "gl2_source_node": "28853558-3f94-401a-b67b-2b4d9c23d109",
    "_id": "a0981700-398c-11ed-9b6d-0242ac140004",
    "logger_name": "com.glodon.gboat3.base.plugin.servlet.ArgResolverFilter",
    "timestamp": "2022-09-21T09:09:21.259Z"
  }
}
参数名示例值参数类型是否必填参数描述
message-Object消息内容,下边为具体的字段
message.gl2_accounted_message_size421Integer-
message.level6Integer-
message.gl2_remote_ip10.0.204.66String-
message.gl2_remote_port47682Integer-
message.streams62f6165c3e8f9b4314589b8bString-
message.gl2_message_id01GDFMR73G8CFQA1HJ2852Z2BPString-
message.sourcehost-10-0-204-66String-
message.messageThe request path is: /actuator/prometheusString-
message.envdevString-
message.gl2_source_input62f0e00d88b7eb6e6a307295String-
message.app_namegdmpString-
message.level_nameINFOString-
message.full_message2022-09-21 17:09:21,259 - [http-nio-18090-exec-5] INFO c.g.g.b.p.servlet.ArgResolverFilter - The request path is: /actuator/prometheusString-
message.thread_namehttp-nio-18090-exec-5String-
message.gl2_source_node28853558-3f94-401a-b67b-2b4d9c23d109String-
message._ida0981700-398c-11ed-9b6d-0242ac140004String-
message.logger_namecom.glodon.gboat3.base.plugin.servlet.ArgResolverFilterString-
message.timestamp2022-09-21T09:09:21.259ZString-
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
无返回数据 返回状态码为204
错误响应示例
"message"
"Stream <632acfca83ac345b77756e21> not found!"

/graylog/Streams/StreamRule

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/Streams/StreamRule/01 获取规则 列表

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId/rules

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
streamId6371a9cd42828a77d760d0e9streamid
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"total": 1,
	"stream_rules": [
		{
			"field": "app_name",
			"stream_id": "6371a9cd42828a77d760d0e9",
			"description": "",
			"id": "6371ad2142828a77d760d502",
			"type": 1,
			"inverted": false,
			"value": "example_glef_graylog"
		}
	]
}

/graylog/Streams/StreamRule/02 创建StreamRule

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId/rules

请求方式

POST

Content-Type

json

路径变量
参数名示例值参数描述
streamId6371a9cd42828a77d760d0e9streamId
请求Body参数
{
  "field": "environment",
  "description": "环境",
  "inverted": false,
  "type": 6,
  "value": "pre"
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"streamrule_id": "6375a8b242828a77d765906f"
}

/graylog/Streams/StreamRule/03 获取ruleTypes

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId/rules/types

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
streamId6371a9cd42828a77d760d0e9streamId
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
[
	{
		"id": 1,
		"name": "EXACT",
		"short_desc": "match exactly",
		"long_desc": "match exactly"
	},
	{
		"id": 2,
		"name": "REGEX",
		"short_desc": "match regular expression",
		"long_desc": "match regular expression"
	},
	{
		"id": 3,
		"name": "GREATER",
		"short_desc": "greater than",
		"long_desc": "be greater than"
	},
	{
		"id": 4,
		"name": "SMALLER",
		"short_desc": "smaller than",
		"long_desc": "be smaller than"
	},
	{
		"id": 5,
		"name": "PRESENCE",
		"short_desc": "field presence",
		"long_desc": "be present"
	},
	{
		"id": 6,
		"name": "CONTAINS",
		"short_desc": "contain",
		"long_desc": "contain"
	},
	{
		"id": 7,
		"name": "ALWAYS_MATCH",
		"short_desc": "always match",
		"long_desc": "always match"
	},
	{
		"id": 8,
		"name": "MATCH_INPUT",
		"short_desc": "match input",
		"long_desc": "match input"
	}
]

/graylog/Streams/StreamRule/04 获取Stream的单个规则

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId/rules/:streamRuleId

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
streamId6371a9cd42828a77d760d0e9streamid
streamRuleId63734bd542828a77d762c8destreamRuleId
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"total": 1,
	"stream_rules": [
		{
			"field": "app_name",
			"stream_id": "6371a9cd42828a77d760d0e9",
			"description": "",
			"id": "6371ad2142828a77d760d502",
			"type": 1,
			"inverted": false,
			"value": "example_glef_graylog"
		}
	]
}
错误响应示例
{
	"type": "ApiError",
	"message": "Couldn't find stream rule with ID6371a9cd42828a77d760d0e9"
}

/graylog/Streams/StreamRule/05 更新StreamRule

requestBody参数不能多,必须一致
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId/rules/:streamRuleId

请求方式

PUT

Content-Type

json

路径变量
参数名示例值参数描述
streamId6371a9cd42828a77d760d0e9streamId
streamRuleId637358ce42828a77d762d87e-
请求Body参数
{
	"field": "environment",
	"description": "环境fff",
	"type": 6,
	"inverted": false,
	"value": "pre"
}
参数名示例值参数类型是否必填参数描述
fieldenvironmentString-
description环境fffString-
type6Integer-
invertedfalseBoolean-
valuepreString-
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"streamrule_id": "637358ce42828a77d762d87e"
}
错误响应示例
{
	"type": "ApiError",
	"message": "Unable to map property stream_id.\nKnown properties include: value, type, description, inverted, field"
}

/graylog/Streams/StreamRule/06 删除StreamRule

requestBody参数不能多,必须一致
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId/rules/:streamRuleId

请求方式

DELETE

Content-Type

json

路径变量
参数名示例值参数描述
streamId6371a9cd42828a77d760d0e9streamId
streamRuleId637358ce42828a77d762d87e-
请求Body参数

参数名示例值参数类型是否必填参数描述
fieldenvironmentString-
description环境fffString-
type6Integer-
invertedfalseBoolean-
valuepreString-
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
错误响应示例
{
	"type": "ApiError",
	"message": "Unable to map property stream_id.\nKnown properties include: value, type, description, inverted, field"
}

/graylog/alerts

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/01 获取Stream流的告警条件

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/streams/:streamId/alerts/conditions

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
streamId62f6165c3e8f9b4314589b8bstreamId
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/events【事件】

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/events【事件】/01 查询时间定义

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/evnets/search

请求方式

GET

Content-Type

json

请求Body参数
{
  "query": "",
  "page": 1,
  "per_page": 25,
  "filter": {
    "alerts": "only"
  },
  "timerange": {
    "type": "relative",
    "range": 3600
  }
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/新建接口

暂无描述
接口状态

开发中

接口URL

http://10.0.107.158:29000/api/events/search

请求方式

POST

Content-Type

json

请求Body参数
{
	"page": 1,
	"per_page": 25,
	"timerange": {
		"type": "relative",
		"range": 36000
	},
	"query": "",
	"filter": {
		"alerts": "include",
		"event_definitions": []
	},
	"sort_direction": "asc"
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/告警规则

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/告警规则/新建告警规则

暂无描述
接口状态

开发中

接口URL

http://10.0.107.158:29000/api/events/definitions?schedule=true

请求方式

POST

Content-Type

json

请求Query参数
参数名示例值参数类型是否必填参数描述
scheduletrueString-
请求Body参数
{
  "title": "222",
  "description": "",
  "priority": 2,
  "config": {
    "query": "",
    "query_parameters": [],
    "streams": [],
    "search_within_ms": 60000,
    "execute_every_ms": 60000,
    "group_by": [],
    "series": [],
    "conditions": {},
    "type": "aggregation-v1"
  },
  "field_spec": {
    "1": {
      "data_type": "string",
      "providers": [
        {
          "template": "${source.message}",
          "type": "template-v1"
        }
      ]
    }
  },
  "key_spec": [
    "1"
  ],
  "notification_settings": {
    "grace_period_ms": 0,
    "backlog_size": null
  },
  "notifications": [
    {
      "notification_id": "6316ab7a83ac345b775f38e0"
    }
  ],
  "alert": true
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/告警规则/编辑告警规则

暂无描述
接口状态

开发中

接口URL

http://10.0.107.158:29000/api/events/definitions/6368b01de930a905f362e3ee?schedule=true

请求方式

PUT

Content-Type

json

请求Query参数
参数名示例值参数类型是否必填参数描述
scheduletrueString-
请求Body参数
{
  "id": "6368b01de930a905f362e3ee",
  "title": "111",
  "description": "范德萨发11",
  "priority": 2,
  "alert": true,
  "config": {
    "type": "aggregation-v1",
    "query": "",
    "query_parameters": [],
    "streams": [],
    "group_by": [],
    "series": [],
    "conditions": {
      "expression": null
    },
    "search_within_ms": 60000,
    "execute_every_ms": 60000
  },
  "field_spec": {
    "1": {
      "data_type": "string",
      "providers": [
        {
          "type": "template-v1",
          "template": "${source.message}",
          "require_values": false
        }
      ]
    }
  },
  "key_spec": [
    "1"
  ],
  "notification_settings": {
    "grace_period_ms": 0,
    "backlog_size": 0
  },
  "notifications": [
    {
      "notification_id": "6316ab7a83ac345b775f38e0",
      "notification_parameters": null
    }
  ],
  "storage": [
    {
      "type": "persist-to-streams-v1",
      "streams": [
        "000000000000000000000002"
      ]
    }
  ]
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/告警规则/删除告警规则

暂无描述
接口状态

开发中

接口URL

http://10.0.107.158:29000/api/events/definitions/6368b081e930a905f362e646

请求方式

DELETE

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/告警规则/停用告警规则

暂无描述
接口状态

开发中

接口URL

http://10.0.107.158:29000/api/events/definitions/6368b01de930a905f362e3ee/unschedule

请求方式

PUT

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/告警规则/启用告警规则

暂无描述
接口状态

开发中

接口URL

http://10.0.107.158:29000/api/events/definitions/6368b01de930a905f362e3ee/schedule

请求方式

PUT

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/webhook

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/webhook/创建webhook

暂无描述
接口状态

开发中

接口URL

http://10.0.107.158:29000/api/events/notifications

请求方式

POST

Content-Type

json

请求Body参数
{
  "title": "cc",
  "description": "",
  "config": {
    "color": "#FF0000",
    "webhook_url": "http://www.baidu.com",
    "channel": "#channel",
    "custom_message": "--- [Event Definition] ---------------------------\nTitle:       ${event_definition_title}\nType:        ${event_definition_type}\n--- [Event] --------------------------------------\nTimestamp:            ${event.timestamp}\nMessage:              ${event.message}\nSource:               ${event.source}\nKey:                  ${event.key}\nPriority:             ${event.priority}\nAlert:                ${event.alert}\nTimestamp Processing: ${event.timestamp}\nTimerange Start:      ${event.timerange_start}\nTimerange End:        ${event.timerange_end}\nEvent Fields:\n${foreach event.fields field}\n${field.key}: ${field.value}\n${end}\n${if backlog}\n--- [Backlog] ------------------------------------\nLast messages accounting for this alert:\n${foreach backlog message}\n${message.timestamp}  ::  ${message.source}  ::  ${message.message}\n${message.message}\n${end}${end}\n",
    "user_name": "Graylog",
    "notify_channel": false,
    "link_names": false,
    "icon_url": "",
    "icon_emoji": "",
    "backlog_size": 0,
    "type": "slack-notification-v1"
  }
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/webhook/修改webhook

暂无描述
接口状态

开发中

接口URL

http://10.0.107.158:29000/api/events/notifications/6368dbcbe930a905f3639898

请求方式

PUT

Content-Type

json

请求Body参数
{
  "id": "6368dbcbe930a905f3639898",
  "title": "cc",
  "description": "",
  "config": {
    "type": "slack-notification-v1",
    "backlog_size": 0,
    "color": "#FF0000",
    "webhook_url": "http://www.baidu.com",
    "channel": "#channel",
    "custom_message": "--- [Event Definition] ---------------------------\nTitle:       ${event_definition_title}\nType:        ${event_definition_type}\n--- [Event] --------------------------------------\nTimestamp:            ${event.timestamp}\nMessage:              ${event.message}\nSource:               ${event.source}\nKey:                  ${event.key}\nPriority:             ${event.priority}\nAlert:                ${event.alert}\nTimestamp Processing: ${event.timestamp}\nTimerange Start:      ${event.timerange_start}\nTimerange End:        ${event.timerange_end}\nEvent Fields:\n${foreach event.fields field}\n${field.key}: ${field.value}\n${end}\n${if backlog}\n--- [Backlog] ------------------------------------\nLast messages accounting for this alert:\n${foreach backlog message}\n${message.timestamp}  ::  ${message.source}  ::  ${message.message}\n${message.message}\n${end}${end}\n",
    "user_name": "Graylog",
    "notify_channel": false,
    "link_names": false,
    "icon_url": "",
    "icon_emoji": ""
  }
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/webhook/删除webhook

暂无描述
接口状态

开发中

接口URL

http://10.0.107.158:29000/api/events/notifications/6368dbcbe930a905f3639898

请求方式

DELETE

Content-Type

json

请求Body参数
{
  "title": "cc",
  "description": "",
  "config": {
    "color": "#FF0000",
    "webhook_url": "http://www.baidu.com",
    "channel": "#channel",
    "custom_message": "--- [Event Definition] ---------------------------\nTitle:       ${event_definition_title}\nType:        ${event_definition_type}\n--- [Event] --------------------------------------\nTimestamp:            ${event.timestamp}\nMessage:              ${event.message}\nSource:               ${event.source}\nKey:                  ${event.key}\nPriority:             ${event.priority}\nAlert:                ${event.alert}\nTimestamp Processing: ${event.timestamp}\nTimerange Start:      ${event.timerange_start}\nTimerange End:        ${event.timerange_end}\nEvent Fields:\n${foreach event.fields field}\n${field.key}: ${field.value}\n${end}\n${if backlog}\n--- [Backlog] ------------------------------------\nLast messages accounting for this alert:\n${foreach backlog message}\n${message.timestamp}  ::  ${message.source}  ::  ${message.message}\n${message.message}\n${end}${end}\n",
    "user_name": "Graylog",
    "notify_channel": false,
    "link_names": false,
    "icon_url": "",
    "icon_emoji": "",
    "backlog_size": 0,
    "type": "slack-notification-v1"
  }
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/alerts/webhook/测试webhook地址

暂无描述
接口状态

开发中

接口URL

http://10.0.107.158:29000/api/events/notifications/6368dc40e930a905f363992e/test

请求方式

POST

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System/sidecars

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System/sidecars/01 根据条件分页查询sidecars

http://10.0.107.158:29000/api/api-browser/global/index.html#!/Sidecar/sidecars_get_0
接口状态

开发中

接口URL

{{graylog}}/api/sidecars?page=1&per_page=50&query=75&sort=node_name&order=asc&only_active=false

请求方式

GET

Content-Type

json

请求Query参数
参数名示例值参数类型是否必填参数描述
page1Text当前页
per_page50Text每页大小
query75Text查询条件
sortnode_nameText排序字段
orderascText排序方式
only_activefalseText只查询在线的
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"query": "",
	"total": 3,
	"only_active": false,
	"sort": "node_name",
	"order": "asc",
	"sidecars": [
		{
			"active": true,
			"node_id": "067ba9da-5c56-4f8d-8d8d-7ab737b61706",
			"node_name": "10.0.204.66",
			"node_details": {
				"operating_system": "Linux",
				"ip": "10.0.204.66",
				"metrics": {
					"disks_75": [],
					"cpu_idle": 93.12,
					"load_1": 0.37
				},
				"log_file_list": null,
				"status": {
					"status": 0,
					"message": "1 running / 0 stopped / 0 failing",
					"collectors": [
						{
							"collector_id": "62ecbdd49ec96a0baedb2521",
							"status": 0,
							"message": "Running",
							"verbose_message": ""
						}
					]
				}
			},
			"assignments": [
				{
					"collector_id": "62ecbdd49ec96a0baedb2521",
					"configuration_id": "630ca6bb23481c2cd761e684"
				}
			],
			"last_seen": "2022-09-06T03:11:15.027Z",
			"sidecar_version": "1.2.0",
			"collectors": null
		},
		{
			"active": true,
			"node_id": "0b7c14a8-811f-413a-ab4e-001f35c6b4af",
			"node_name": "192.168.124.107",
			"node_details": {
				"operating_system": "Windows",
				"ip": "2.0.1.4",
				"metrics": {
					"disks_75": [],
					"cpu_idle": 76.23,
					"load_1": 0
				},
				"log_file_list": null,
				"status": {
					"status": 0,
					"message": "1 running / 0 stopped / 0 failing",
					"collectors": [
						{
							"collector_id": "62ecbdd59ec96a0baedb2527",
							"status": 0,
							"message": "Running",
							"verbose_message": ""
						}
					]
				}
			},
			"assignments": [
				{
					"collector_id": "62ecbdd59ec96a0baedb2527",
					"configuration_id": "63083e2823481c2cd7594feb"
				}
			],
			"last_seen": "2022-09-06T03:11:18.100Z",
			"sidecar_version": "1.2.0",
			"collectors": null
		},
		{
			"active": true,
			"node_id": "6a23892b-e8d9-42e8-8f74-0ef7cfe606e9",
			"node_name": "192.168.124.75",
			"node_details": {
				"operating_system": "Windows",
				"ip": "192.168.124.75",
				"metrics": {
					"disks_75": [
						"C:\\ (78%)",
						"D:\\ (83%)"
					],
					"cpu_idle": 91.29,
					"load_1": 0
				},
				"log_file_list": null,
				"status": {
					"status": 0,
					"message": "1 running / 0 stopped / 0 failing",
					"collectors": [
						{
							"collector_id": "62ecbdd59ec96a0baedb2527",
							"status": 0,
							"message": "Running",
							"verbose_message": ""
						}
					]
				}
			},
			"assignments": [
				{
					"collector_id": "62ecbdd59ec96a0baedb2527",
					"configuration_id": "63083e2823481c2cd7594feb"
				}
			],
			"last_seen": "2022-09-06T03:10:42.977Z",
			"sidecar_version": "1.2.0",
			"collectors": null
		}
	],
	"filters": null,
	"pagination": {
		"total": 3,
		"count": 3,
		"page": 1,
		"per_page": 50
	}
}
参数名示例值参数类型参数描述
query-Object
total3Number
only_active--
sortnode_nameString
orderascString
sidecars-Object
sidecars.activetrue-状态,true为正常,false为异常
sidecars.node_id067ba9da-5c56-4f8d-8d8d-7ab737b61706String
sidecars.node_name10.0.204.66String节点名称
sidecars.node_details-Object
sidecars.node_details.operating_systemLinuxString系统类型
sidecars.node_details.ip10.0.204.66Stringip地址
sidecars.node_details.metrics-Object
sidecars.node_details.metrics.disks_75{}Object
sidecars.node_details.metrics.cpu_idle93.12Number
sidecars.node_details.metrics.load_10.37Number
sidecars.node_details.log_file_list-Object
sidecars.node_details.status-Object
sidecars.node_details.status.status-Number
sidecars.node_details.status.message1 running / 0 stopped / 0 failingString
sidecars.node_details.status.collectors-Object
sidecars.node_details.status.collectors.collector_id62ecbdd49ec96a0baedb2521String
sidecars.node_details.status.collectors.status-Number
sidecars.node_details.status.collectors.messageRunningString
sidecars.node_details.status.collectors.verbose_message-Object
sidecars.assignments-Object
sidecars.assignments.collector_id62ecbdd49ec96a0baedb2521String
sidecars.assignments.configuration_id630ca6bb23481c2cd761e684String
sidecars.last_seen2022-09-06T03:11:15.027ZString最后检测时间
sidecars.sidecar_version1.2.0Stringsidecars版本
sidecars.collectors-Object
filters-Object
pagination-Object
pagination.total3Number
pagination.count3Number
pagination.page1Number分页页码,数字类型
pagination.per_page50Number

/graylog/System/sidecars/02 查询所有的sidecars

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/sidecars/all

请求方式

GET

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System/sidecars/03 获取sidecar详情

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/sidecars/:node_id

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
node_id6a23892b-e8d9-42e8-8f74-0ef7cfe606e9节点id
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System/indices

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System/indices/01 创建索引

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/index_sets

请求方式

POST

Content-Type

json

请求Body参数
{
    "title": "标题",
    "description": "描述信息",
    "index_prefix": "shensr",
    "writable": true,
    "can_be_default": true,
    "shards": 4,
    "replicas": 0,
    "retention_strategy_class": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy",
    "retention_strategy": {
      "max_number_of_indices": 20,
      "type": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfig"
    },
    "rotation_strategy_class": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategy",
    "rotation_strategy": {
      "type": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfig",
    },
    "index_analyzer": "standard",
    "index_optimization_max_num_segments": 1,
    "index_optimization_disabled": false,
    "field_type_refresh_interval": 5000,
    "creation_date": "2022-09-21T05:52:43.063Z"
  }
参数名示例值参数类型是否必填参数描述
title标题String名称
description描述信息String描述信息
index_prefixshensrString-
writabletrueBoolean-
can_be_defaulttrueBoolean-
shards4Integer分片
replicas0Integer副本数
retention_strategy_classorg.graylog2.indexer.retention.strategies.DeletionRetentionStrategyString-
retention_strategy-Object-
retention_strategy.max_number_of_indices20Integer-
retention_strategy.typeorg.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfigString-
rotation_strategy_classorg.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyString-
rotation_strategy-Object-
rotation_strategy.typeorg.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfigString-
index_analyzerstandardString-
index_optimization_max_num_segments1Integer-
index_optimization_disabledfalseBoolean-
field_type_refresh_interval5000Integer-
creation_date2022-09-21T05:52:43.063ZString-
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"id": "632aa9f083ac345b777543f4",
	"title": "标题",
	"description": "描述信息",
	"can_be_default": true,
	"index_prefix": "shensr",
	"shards": 4,
	"replicas": 0,
	"rotation_strategy_class": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategy",
	"rotation_strategy": {
		"type": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfig",
		"max_docs_per_index": 0
	},
	"retention_strategy_class": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy",
	"retention_strategy": {
		"type": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfig",
		"max_number_of_indices": 20
	},
	"creation_date": "2022-09-21T05:52:43.063Z",
	"index_analyzer": "standard",
	"index_optimization_max_num_segments": 1,
	"index_optimization_disabled": false,
	"field_type_refresh_interval": 5000,
	"index_template_type": null,
	"writable": true,
	"default": false
}
参数名示例值参数类型参数描述
id632aa9f083ac345b777543f4String索引ID
title标题String名称
description描述信息String描述信息
can_be_defaulttrueBoolean
index_prefixshensrString
shards4Integer分片数
replicas0Integer副本数
rotation_strategy_classorg.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyString
rotation_strategy-Object
rotation_strategy.typeorg.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfigString
rotation_strategy.max_docs_per_index0Integer
retention_strategy_classorg.graylog2.indexer.retention.strategies.DeletionRetentionStrategyString
retention_strategy-Object
retention_strategy.typeorg.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfigString
retention_strategy.max_number_of_indices20Integer
creation_date2022-09-21T05:52:43.063ZString
index_analyzerstandardString
index_optimization_max_num_segments1Integer
index_optimization_disabledfalseBoolean
field_type_refresh_interval5000Integer
index_template_typenullNull
writabletrueBoolean
defaultfalseBoolean

/graylog/System/indices/02 查询全部索引

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/index_sets?skip=0&limit=0&stats=true

请求方式

GET

Content-Type

json

请求Query参数
参数名示例值参数类型是否必填参数描述
skip0String当前页 为0 不分页
limit0String每页条数为 0不分页
statstrueString是否包含索引统计数据
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"total": 5,
	"index_sets": [
		{
			"id": "6305e74923481c2cd7551bfa",
			"title": "gdmp",
			"description": "运维系统index,各个环境都存储在这个index中",
			"can_be_default": true,
			"index_prefix": "gdmp_pro",
			"shards": 4,
			"replicas": 0,
			"rotation_strategy_class": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategy",
			"rotation_strategy": {
				"type": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfig",
				"max_docs_per_index": 20000000
			},
			"retention_strategy_class": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy",
			"retention_strategy": {
				"type": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfig",
				"max_number_of_indices": 20
			},
			"creation_date": "2022-08-24T08:54:33.459Z",
			"index_analyzer": "standard",
			"index_optimization_max_num_segments": 1,
			"index_optimization_disabled": false,
			"field_type_refresh_interval": 5000,
			"index_template_type": null,
			"writable": true,
			"default": false
		}
	],
	"stats": {}
}
参数名示例值参数类型参数描述
total5Integer
index_sets-Object
index_sets.id6305e74923481c2cd7551bfaString
index_sets.titlegdmpString名称
index_sets.description运维系统index,各个环境都存储在这个index中String描述
index_sets.can_be_defaulttrueBoolean
index_sets.index_prefixgdmp_proString
index_sets.shards4Integer
index_sets.replicas0Integer
index_sets.rotation_strategy_classorg.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyString
index_sets.rotation_strategy-Object
index_sets.rotation_strategy.typeorg.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfigString
index_sets.rotation_strategy.max_docs_per_index20000000Integer
index_sets.retention_strategy_classorg.graylog2.indexer.retention.strategies.DeletionRetentionStrategyString
index_sets.retention_strategy-Object
index_sets.retention_strategy.typeorg.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfigString
index_sets.retention_strategy.max_number_of_indices20Integer
index_sets.creation_date2022-08-24T08:54:33.459ZString创建时间
index_sets.index_analyzerstandardString
index_sets.index_optimization_max_num_segments1Integer
index_sets.index_optimization_disabledfalseBoolean
index_sets.field_type_refresh_interval5000Integer
index_sets.index_template_typenullNull
index_sets.writabletrueBoolean
index_sets.defaultfalseBoolean
stats-Object

/graylog/System/indices/02 查询单个索引

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/index_sets/:id

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
id6330077083ac345b777b43e0-
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"total": 5,
	"index_sets": [
		{
			"id": "6305e74923481c2cd7551bfa",
			"title": "gdmp",
			"description": "运维系统index,各个环境都存储在这个index中",
			"can_be_default": true,
			"index_prefix": "gdmp_pro",
			"shards": 4,
			"replicas": 0,
			"rotation_strategy_class": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategy",
			"rotation_strategy": {
				"type": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfig",
				"max_docs_per_index": 20000000
			},
			"retention_strategy_class": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy",
			"retention_strategy": {
				"type": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfig",
				"max_number_of_indices": 20
			},
			"creation_date": "2022-08-24T08:54:33.459Z",
			"index_analyzer": "standard",
			"index_optimization_max_num_segments": 1,
			"index_optimization_disabled": false,
			"field_type_refresh_interval": 5000,
			"index_template_type": null,
			"writable": true,
			"default": false
		}
	],
	"stats": {}
}
参数名示例值参数类型参数描述
total5Integer
index_sets-Object
index_sets.id6305e74923481c2cd7551bfaString
index_sets.titlegdmpString名称
index_sets.description运维系统index,各个环境都存储在这个index中String描述
index_sets.can_be_defaulttrueBoolean
index_sets.index_prefixgdmp_proString
index_sets.shards4Integer
index_sets.replicas0Integer
index_sets.rotation_strategy_classorg.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyString
index_sets.rotation_strategy-Object
index_sets.rotation_strategy.typeorg.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfigString
index_sets.rotation_strategy.max_docs_per_index20000000Integer
index_sets.retention_strategy_classorg.graylog2.indexer.retention.strategies.DeletionRetentionStrategyString
index_sets.retention_strategy-Object
index_sets.retention_strategy.typeorg.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfigString
index_sets.retention_strategy.max_number_of_indices20Integer
index_sets.creation_date2022-08-24T08:54:33.459ZString创建时间
index_sets.index_analyzerstandardString
index_sets.index_optimization_max_num_segments1Integer
index_sets.index_optimization_disabledfalseBoolean
index_sets.field_type_refresh_interval5000Integer
index_sets.index_template_typenullNull
index_sets.writabletrueBoolean
index_sets.defaultfalseBoolean
stats-Object

/graylog/System/indices/03 获取索引状态【全部】

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/index_sets/stats

请求方式

GET

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"indices": 7,
	"documents": 15176148,
	"size": 4962156468
}
参数名示例值参数类型参数描述
indices7Integer索引数量
documents15176148Integer文档数量
size4962156468Integer大小,单位为字节,转为为kb(千字节)需要除以1024 转为为GB (÷(102410241024))【http://www.qikula.com/images/9639139849.html】

/graylog/System/indices/04 删除索引

# delete请求。
restful形式的。
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/index_sets/:id?delete_indices=true

请求方式

DELETE

Content-Type

json

请求Query参数
参数名示例值参数类型是否必填参数描述
delete_indicestrueString是否删除索引,删除es中的索引
路径变量
参数名示例值参数描述
id632aa9f083ac345b777543f4索引ID
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System/indices/05 获取索引状态【单个】

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/index_sets/:id/stats

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
id6305e74923481c2cd7551bfa索引ID
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"indices": 1,
	"documents": 2431560,
	"size": 1258577622
}
参数名示例值参数类型参数描述
indices1Integer索引数量
documents2431560Integer文档
size1258577622Integer大小,单位为字节,转为为kb(千字节)需要除以1024 转为为GB (÷(102410241024))【http://www.qikula.com/images/9639139849.html】

/graylog/System/indices/06 更新索引

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/index_sets/:id

请求方式

PUT

Content-Type

json

路径变量
参数名示例值参数描述
id632aa5ea83ac345b77753f73索引ID
请求Body参数
{
	"id": "632aa5ea83ac345b77753f73",
	"title": "test",
	"description": "test",
	"can_be_default": true,
	"index_prefix": "test",
	"shards": 4,
	"replicas": 0,
	"rotation_strategy_class": "org.graylog2.indexer.rotation.strategies.TimeBasedRotationStrategy",
	"rotation_strategy": {
		"type": "org.graylog2.indexer.rotation.strategies.TimeBasedRotationStrategyConfig",
		"rotation_period": "P1D",
		"max_rotation_period": null
	},
	"retention_strategy_class": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy",
	"retention_strategy": {
		"type": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfig",
		"max_number_of_indices": 20
	},
	"creation_date": "2022-09-21T05:52:43.063Z",
	"index_analyzer": "standard",
	"index_optimization_max_num_segments": 1,
	"index_optimization_disabled": false,
	"field_type_refresh_interval": 5000,
	"index_template_type": null,
	"writable": true,
	"default": false
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System/indices/retention【保留策略】

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System/indices/retention【保留策略】/01 获取所有保留策略

/api/system/indices/retention/strategies/{strategy}

strategy:为type后数据,本质是一个全类名
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/retention/strategies

请求方式

GET

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"total": 3,
	"strategies": [
		{
			"type": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategy",
			"default_config": {
				"type": "org.graylog2.indexer.retention.strategies.DeletionRetentionStrategyConfig",
				"max_number_of_indices": 20
			},
			"json_schema": {
				"type": "object",
				"id": "urn:jsonschema:org:graylog2:indexer:retention:strategies:DeletionRetentionStrategyConfig",
				"properties": {
					"max_number_of_indices": {
						"type": "integer"
					},
					"type": {
						"type": "string"
					}
				}
			}
		},
		{
			"type": "org.graylog2.indexer.retention.strategies.ClosingRetentionStrategy",
			"default_config": {
				"type": "org.graylog2.indexer.retention.strategies.ClosingRetentionStrategyConfig",
				"max_number_of_indices": 20
			},
			"json_schema": {
				"type": "object",
				"id": "urn:jsonschema:org:graylog2:indexer:retention:strategies:ClosingRetentionStrategyConfig",
				"properties": {
					"max_number_of_indices": {
						"type": "integer"
					},
					"type": {
						"type": "string"
					}
				}
			}
		},
		{
			"type": "org.graylog2.indexer.retention.strategies.NoopRetentionStrategy",
			"default_config": {
				"type": "org.graylog2.indexer.retention.strategies.NoopRetentionStrategyConfig",
				"max_number_of_indices": 2147483647
			},
			"json_schema": {
				"type": "object",
				"id": "urn:jsonschema:org:graylog2:indexer:retention:strategies:NoopRetentionStrategyConfig",
				"properties": {
					"max_number_of_indices": {
						"type": "integer"
					},
					"type": {
						"type": "string"
					}
				}
			}
		}
	]
}

/graylog/System/indices/retention【保留策略】/02 获取具体的保留策略

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/retention/strategies/:strategy

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
strategyorg.graylog2.indexer.retention.strategies.NoopRetentionStrategy策略名称,为type后的数据
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"type": "org.graylog2.indexer.retention.strategies.NoopRetentionStrategy",
	"default_config": {
		"type": "org.graylog2.indexer.retention.strategies.NoopRetentionStrategyConfig",
		"max_number_of_indices": 2147483647
	},
	"json_schema": {
		"type": "object",
		"id": "urn:jsonschema:org:graylog2:indexer:retention:strategies:NoopRetentionStrategyConfig",
		"properties": {
			"max_number_of_indices": {
				"type": "integer"
			},
			"type": {
				"type": "string"
			}
		}
	}
}

/graylog/System/indices/rotation【轮换策略】

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System/indices/rotation【轮换策略】/01 获取所有轮换策略

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/rotation/strategies

请求方式

GET

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"total": 3,
	"strategies": [
		{
			"type": "org.graylog2.indexer.rotation.strategies.SizeBasedRotationStrategy",
			"default_config": {
				"type": "org.graylog2.indexer.rotation.strategies.SizeBasedRotationStrategyConfig",
				"max_size": 1073741824
			},
			"json_schema": {
				"type": "object",
				"id": "urn:jsonschema:org:graylog2:indexer:rotation:strategies:SizeBasedRotationStrategyConfig",
				"properties": {
					"max_size": {
						"type": "integer"
					},
					"type": {
						"type": "string"
					}
				}
			}
		},
		{
			"type": "org.graylog2.indexer.rotation.strategies.TimeBasedRotationStrategy",
			"default_config": {
				"type": "org.graylog2.indexer.rotation.strategies.TimeBasedRotationStrategyConfig",
				"rotation_period": "P1D",
				"max_rotation_period": null
			},
			"json_schema": {
				"type": "object",
				"id": "urn:jsonschema:org:graylog2:indexer:rotation:strategies:TimeBasedRotationStrategyConfig",
				"properties": {
					"type": {
						"type": "string"
					},
					"rotation_period": {
						"type": "string"
					},
					"max_rotation_period": {
						"type": "string"
					}
				}
			}
		},
		{
			"type": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategy",
			"default_config": {
				"type": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfig",
				"max_docs_per_index": 20000000
			},
			"json_schema": {
				"type": "object",
				"id": "urn:jsonschema:org:graylog2:indexer:rotation:strategies:MessageCountRotationStrategyConfig",
				"properties": {
					"max_docs_per_index": {
						"type": "integer"
					},
					"type": {
						"type": "string"
					}
				}
			}
		}
	]
}

/graylog/System/indices/rotation【轮换策略】/02 查询具体的策略

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/indices/rotation/strategies/:strategy

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
strategyorg.graylog2.indexer.rotation.strategies.MessageCountRotationStrategy策略名
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"type": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategy",
	"default_config": {
		"type": "org.graylog2.indexer.rotation.strategies.MessageCountRotationStrategyConfig",
		"max_docs_per_index": 20000000
	},
	"json_schema": {
		"type": "object",
		"id": "urn:jsonschema:org:graylog2:indexer:rotation:strategies:MessageCountRotationStrategyConfig",
		"properties": {
			"max_docs_per_index": {
				"type": "integer"
			},
			"type": {
				"type": "string"
			}
		}
	}
}

/graylog/System/inputs

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/System/inputs/01 获取所有inputs

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/system/inputs

请求方式

GET

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"inputs": [
		{
			"title": "Beat input",
			"global": true,
			"name": "Beats",
			"content_pack": null,
			"created_at": "2022-08-10T07:17:08.680Z",
			"type": "org.graylog.plugins.beats.Beats2Input",
			"creator_user_id": "admin",
			"attributes": {
				"recv_buffer_size": 1048576,
				"tcp_keepalive": false,
				"number_worker_threads": 8,
				"tls_client_auth_cert_file": "",
				"bind_address": "0.0.0.0",
				"tls_cert_file": "",
				"port": 5044,
				"tls_key_file": "",
				"tls_enable": false,
				"tls_key_password": "",
				"tls_client_auth": "disabled",
				"override_source": null,
				"no_beats_prefix": false
			},
			"static_fields": {},
			"node": null,
			"id": "62f35b7488b7eb6e6a33251b"
		},
		{
			"title": "gdmp",
			"global": true,
			"name": "GELF UDP",
			"content_pack": null,
			"created_at": "2022-08-11T05:53:52.526Z",
			"type": "org.graylog2.inputs.gelf.udp.GELFUDPInput",
			"creator_user_id": "admin",
			"attributes": {
				"recv_buffer_size": 262144,
				"port": 12201,
				"number_worker_threads": 8,
				"override_source": null,
				"bind_address": "0.0.0.0",
				"decompress_size_limit": 8388608
			},
			"static_fields": {},
			"node": "d50de915-8cda-43ac-9b9b-46713990e00b",
			"id": "62f0e00d88b7eb6e6a307295"
		}
	],
	"total": 2
}

/graylog/input

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/input/新建接口

暂无描述
接口状态

开发中

接口URL

127.0.0.1:8080/api/graylog/input/index

请求方式

POST

Content-Type

json

请求Body参数
{
	"title": "cwdchweduchwedihcwedncjwncweph",
	"type": "Beat",
	"configuration": {
		"port": 5049,
		"address": "0.0.0.111"
	}
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/sidecar

暂无描述
Header参数
参数名示例值参数描述
暂无参数
Query参数
参数名示例值参数描述
暂无参数
Body参数
参数名示例值参数描述
暂无参数
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/sidecar/获取collector默认配置列表

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/sidecar/collectors

请求方式

GET

Content-Type

json

请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"total": 6,
	"collectors": [
		{
			"id": "636b175a1e21d174a6cf84df",
			"name": "filebeat",
			"service_type": "exec",
			"node_operating_system": "linux",
			"executable_path": "/usr/share/filebeat/bin/filebeat",
			"execute_parameters": "-c  %s",
			"validation_parameters": "test config -c %s",
			"default_template": "# Needed for Graylog\nfields_under_root: true\nfields.collector_node_id: ${sidecar.nodeName}\nfields.gl2_source_collector: ${sidecar.nodeId}\nmax_procs: 1 # 限制一个CPU核心,避免过多抢占业务资源\n\nfilebeat.inputs:\n- input_type: log\n  paths:\n    - /var/log/*.log # 日志路径,可以配置多个\n  type: log\n # multiline为多行日志合并,Java类型日志需要配置,其他日志不能使用以下规则,含义:不是以时间开头的都追加到上一条日志后边\n  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'\n  multiline.negate: true\n  multiline.match: after\n  multiline.max_lines: 200  #单一多行匹配聚合的最大行数,超过定义行数后的行会被丢弃,默认500\n  multiline.timeout: 2s     # 超时时间后,即使还未匹配到下一个行日志(下一个多行事件),也将此次匹配的事件刷出 (默认5s)\n  ignore_older: 1h      # 忽略这个时间之前的文件(根据文件改变时间)\n  fields: # 用于对日志进行分类处理,需要与运维系统中配置保持一致\n   app_name: xxxx # 应用名称\n   environment: pre #环境  pro  pre\n   log_type: Java # 日志类型 Java  Nginx\noutput.logstash:\n   hosts: [\"10.0.107.158:5044\"] # graylog服务端IP和端口,默认端口为5044\npath:\n  data: /var/lib/graylog-sidecar/collectors/filebeat/data\n  logs: /var/lib/graylog-sidecar/collectors/filebeat/log"
		},
		{
			"id": "636b175a1e21d174a6cf84e0",
			"name": "winlogbeat",
			"service_type": "svc",
			"node_operating_system": "windows",
			"executable_path": "C:\\Program Files\\Graylog\\sidecar\\winlogbeat.exe",
			"execute_parameters": "-c \"%s\"",
			"validation_parameters": "test config -c \"%s\"",
			"default_template": "# Needed for Graylog\nfields_under_root: true\nfields.collector_node_id: ${sidecar.nodeName}\nfields.gl2_source_collector: ${sidecar.nodeId}\n\noutput.logstash:\n   hosts: [\"192.168.1.1:5044\"]\npath:\n  data: C:\\Program Files\\Graylog\\sidecar\\cache\\winlogbeat\\data\n  logs: C:\\Program Files\\Graylog\\sidecar\\logs\ntags:\n - windows\nwinlogbeat:\n  event_logs:\n   - name: Application\n   - name: System\n   - name: Security"
		},
		{
			"id": "636b175a1e21d174a6cf84e1",
			"name": "nxlog",
			"service_type": "exec",
			"node_operating_system": "linux",
			"executable_path": "/usr/bin/nxlog",
			"execute_parameters": "-f -c %s",
			"validation_parameters": "-v -c %s",
			"default_template": "define ROOT /usr/bin\n\n<Extension gelfExt>\n  Module xm_gelf\n  # Avoid truncation of the short_message field to 64 characters.\n  ShortMessageLength 65536\n</Extension>\n\n<Extension syslogExt>\n  Module xm_syslog\n</Extension>\n\nUser nxlog\nGroup nxlog\n\nModuledir /usr/lib/nxlog/modules\nCacheDir /var/spool/nxlog/data\nPidFile /var/run/nxlog/nxlog.pid\nLogFile /var/log/nxlog/nxlog.log\nLogLevel INFO\n\n\n<Input file>\n\tModule im_file\n\tFile '/var/log/*.log'\n\tPollInterval 1\n\tSavePos\tTrue\n\tReadFromLast True\n\tRecursive False\n\tRenameCheck False\n\tExec $FileName = file_name(); # Send file name with each message\n</Input>\n\n#<Input syslog-udp>\n#\tModule im_udp\n#\tHost 127.0.0.1\n#\tPort 514\n#\tExec parse_syslog_bsd();\n#</Input>\n\n<Output gelf>\n\tModule om_tcp\n\tHost 192.168.1.1\n\tPort 12201\n\tOutputType  GELF_TCP\n\t<Exec>\n\t  # These fields are needed for Graylog\n\t  $gl2_source_collector = '${sidecar.nodeId}';\n\t  $collector_node_id = '${sidecar.nodeName}';\n\t</Exec>\n</Output>\n\n\n<Route route-1>\n  Path file => gelf\n</Route>\n#<Route route-2>\n#  Path syslog-udp => gelf\n#</Route>\n\n\n"
		},
		{
			"id": "636b175a1e21d174a6cf84e2",
			"name": "nxlog",
			"service_type": "svc",
			"node_operating_system": "windows",
			"executable_path": "C:\\Program Files (x86)\\nxlog\\nxlog.exe",
			"execute_parameters": "-c \"%s\"",
			"validation_parameters": "-v -f -c \"%s\"",
			"default_template": "define ROOT C:\\Program Files (x86)\\nxlog\n\nModuledir %ROOT%\\modules\nCacheDir %ROOT%\\data\nPidfile %ROOT%\\data\\nxlog.pid\nSpoolDir %ROOT%\\data\nLogFile %ROOT%\\data\\nxlog.log\nLogLevel INFO\n\n<Extension logrotate>\n    Module  xm_fileop\n    <Schedule>\n        When    @daily\n        Exec    file_cycle('%ROOT%\\data\\nxlog.log', 7);\n     </Schedule>\n</Extension>\n\n\n<Extension gelfExt>\n  Module xm_gelf\n  # Avoid truncation of the short_message field to 64 characters.\n  ShortMessageLength 65536\n</Extension>\n\n<Input eventlog>\n        Module im_msvistalog\n        PollInterval 1\n        SavePos True\n        ReadFromLast True\n        \n        #Channel System\n        #<QueryXML>\n        #  <QueryList>\n        #   <Query Id='1'>\n        #    <Select Path='Security'>*[System/Level=4]</Select>\n        #    </Query>\n        #  </QueryList>\n        #</QueryXML>\n</Input>\n\n\n<Input file>\n\tModule im_file\n\tFile 'C:\\Windows\\MyLogDir\\\\*.log'\n\tPollInterval 1\n\tSavePos\tTrue\n\tReadFromLast True\n\tRecursive False\n\tRenameCheck False\n\tExec $FileName = file_name(); # Send file name with each message\n</Input>\n\n\n<Output gelf>\n\tModule om_tcp\n\tHost 192.168.1.1\n\tPort 12201\n\tOutputType  GELF_TCP\n\t<Exec>\n\t  # These fields are needed for Graylog\n\t  $gl2_source_collector = '${sidecar.nodeId}';\n\t  $collector_node_id = '${sidecar.nodeName}';\n\t</Exec>\n</Output>\n\n\n<Route route-1>\n  Path eventlog => gelf\n</Route>\n<Route route-2>\n  Path file => gelf\n</Route>\n\n"
		},
		{
			"id": "636b175a1e21d174a6cf84e3",
			"name": "filebeat",
			"service_type": "svc",
			"node_operating_system": "windows",
			"executable_path": "C:\\Program Files\\Graylog\\sidecar\\filebeat.exe",
			"execute_parameters": "-c \"%s\"",
			"validation_parameters": "test config -c \"%s\"",
			"default_template": "# Needed for Graylog\nfields_under_root: true\nfields.collector_node_id: ${sidecar.nodeName}\nfields.gl2_source_collector: ${sidecar.nodeId}\nmax_procs: 1 # 限制一个CPU核心,避免过多抢占业务资源\n\ntags:\n - windows\nfilebeat.inputs:\n- type: log\n  enabled: true\n # multiline为多行日志合并,Java类型日志需要配置,其他日志不能使用以下规则,含义:不是以时间开头的都追加到上一条日志后边\n  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'\n  multiline.negate: true # 不符合上述规则\n  multiline.match: after # 追加在上条日志后边\n  ignore_older: 24h      # 忽略这个时间之前的文件(根据文件改变时间)\n  fields: # 用于对日志进行分类处理,需要与运维系统中配置保持一致\n   app_name: example_glef_graylog # 应用服务编码,保持唯一\n   environment: pro # 环境  只支持生产和预生产 pro pre\n   log_type: Java # 日志类型 Java  Nginx\n  paths:\n    - C:\\logs\\*.log # 日志路径,可以配置多个\n\noutput.logstash:\n   hosts: [\"10.0.107.158:5044\"] # graylog服务端IP和端口,默认端口为5044\npath:\n  data: C:\\Program Files\\Graylog\\sidecar\\cache\\filebeat\\data\n  logs: C:\\Program Files\\Graylog\\sidecar\\logs\n    \n"
		},
		{
			"id": "6391a39142828a77d791ab39",
			"name": "filebeat222",
			"service_type": "exec",
			"node_operating_system": "linux",
			"executable_path": "/usr/share/filebeat/bin/filebeat",
			"execute_parameters": "-c  %s",
			"validation_parameters": "test config -c %s",
			"default_template": "# Needed for Graylog\nfields_under_root: true\nfields.collector_node_id: ${sidecar.nodeName}\nfields.gl2_source_collector: ${sidecar.nodeId}\nmax_procs: 1 # 限制一个CPU核心,避免过多抢占业务资源\n\nfilebeat.inputs:\n- input_type: log\n  paths:\n    - /var/log/*.log # 日志路径,可以配置多个\n  type: log\n # multiline为多行日志合并,Java类型日志需要配置,其他日志不能使用以下规则,含义:不是以时间开头的都追加到上一条日志后边\n  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'\n  multiline.negate: true\n  multiline.match: after\n  multiline.max_lines: 200  #单一多行匹配聚合的最大行数,超过定义行数后的行会被丢弃,默认500\n  multiline.timeout: 2s     # 超时时间后,即使还未匹配到下一个行日志(下一个多行事件),也将此次匹配的事件刷出 (默认5s)\n  ignore_older: 1h      # 忽略这个时间之前的文件(根据文件改变时间)\n  fields: # 用于对日志进行分类处理,需要与运维系统中配置保持一致\n   app_name: xxxx # 应用名称\n   environment: pre #环境  pro  pre\n   log_type: Java # 日志类型 Java  Nginx\noutput.logstash:\n   hosts: [\"10.0.107.158:5044\"] # graylog服务端IP和端口,默认端口为5044\npath:\n  data: /var/lib/graylog-sidecar/collectors/filebeat/data\n  logs: /var/lib/graylog-sidecar/collectors/filebeat/log"
		}
	]
}

/graylog/sidecar/获取sidecar列表

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/sidecars?page=1&per_page=1&sort=node_name&order=asc&only_active=true

请求方式

GET

Content-Type

json

请求Query参数
参数名示例值参数类型是否必填参数描述
page1String-
per_page1String-
sortnode_nameString-
orderascString-
only_activetrueString-
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"query": "",
	"total": 8,
	"only_active": true,
	"sort": "node_name",
	"order": "asc",
	"sidecars": [
		{
			"active": true,
			"node_id": "decb8c0e-5411-4d47-8034-6f58ec4930af",
			"node_name": "10.0.107.55",
			"node_details": {
				"operating_system": "Linux",
				"ip": "10.0.107.55",
				"metrics": {
					"disks_75": [],
					"cpu_idle": 98.63,
					"load_1": 0.03
				},
				"log_file_list": null,
				"status": {
					"status": 0,
					"message": "1 running / 0 stopped / 0 failing",
					"collectors": [
						{
							"collector_id": "636b175a1e21d174a6cf84df",
							"status": 0,
							"message": "Running",
							"verbose_message": ""
						}
					]
				}
			},
			"assignments": [
				{
					"collector_id": "636b175a1e21d174a6cf84df",
					"configuration_id": "636b346242828a77d7544808"
				}
			],
			"last_seen": "2022-12-08T03:26:47.594Z",
			"sidecar_version": "1.2.0",
			"collectors": null
		}
	],
	"filters": null,
	"pagination": {
		"total": 4,
		"count": 1,
		"page": 1,
		"per_page": 1
	}
}

/graylog/sidecar/获取配置列表列表

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/sidecar/configurations?query=&page=1&per_page=10

请求方式

GET

Content-Type

json

请求Query参数
参数名示例值参数类型是否必填参数描述
query-String-
page1String-
per_page10String为0 不分页
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"query": "",
	"total": 8,
	"only_active": true,
	"sort": "node_name",
	"order": "asc",
	"sidecars": [
		{
			"active": true,
			"node_id": "decb8c0e-5411-4d47-8034-6f58ec4930af",
			"node_name": "10.0.107.55",
			"node_details": {
				"operating_system": "Linux",
				"ip": "10.0.107.55",
				"metrics": {
					"disks_75": [],
					"cpu_idle": 98.63,
					"load_1": 0.03
				},
				"log_file_list": null,
				"status": {
					"status": 0,
					"message": "1 running / 0 stopped / 0 failing",
					"collectors": [
						{
							"collector_id": "636b175a1e21d174a6cf84df",
							"status": 0,
							"message": "Running",
							"verbose_message": ""
						}
					]
				}
			},
			"assignments": [
				{
					"collector_id": "636b175a1e21d174a6cf84df",
					"configuration_id": "636b346242828a77d7544808"
				}
			],
			"last_seen": "2022-12-08T03:26:47.594Z",
			"sidecar_version": "1.2.0",
			"collectors": null
		}
	],
	"filters": null,
	"pagination": {
		"total": 4,
		"count": 1,
		"page": 1,
		"per_page": 1
	}
}

/graylog/sidecar/获取配置详情

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/sidecar/configurations/:configurationId

请求方式

GET

Content-Type

json

路径变量
参数名示例值参数描述
configurationId63788fab42828a77d769ffac-
请求Body参数

认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本
成功响应示例
{
	"id": "63788fab42828a77d769ffac",
	"collector_id": "636b175a1e21d174a6cf84df",
	"name": "10.0.107.214",
	"color": "#FFFFFF",
	"template": "# Needed for Graylog\nfields_under_root: true\nfields.collector_node_id: ${sidecar.nodeName}\nfields.gl2_source_collector: ${sidecar.nodeId}\n\nfilebeat.inputs:\n- input_type: log\n  paths:\n    - /data/app/test-gdmp/gdmp-server/logs/*.log\n  type: log\n  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'\n  multiline.negate: true\n  multiline.match: after\n  fields:\n   app_name: gdmp_test\n   environment: pre\n   log_type: Java\noutput.logstash:\n   hosts: [\"10.0.107.158:5044\"]\npath:\n  data: /var/lib/graylog-sidecar/collectors/filebeat/data\n  logs: /var/lib/graylog-sidecar/collectors/filebeat/log"
}
错误响应示例
{
	"type": "ApiError",
	"message": "invalid hexadecimal representation of an ObjectId: [63788fab42828fa77d769ffac]"
}

/graylog/sidecar/新增sidecar-configuration配置

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/sidecar/configurations

请求方式

POST

Content-Type

json

请求Body参数
{
	"name": "rete",
	"color": "#FFFFFF",
	"collector_id": "636b175a1e21d174a6cf84df",
	"template": "# Needed for Graylog\nfields_under_root: true\nfields.collector_node_id: ${sidecar.nodeName}\nfields.gl2_source_collector: ${sidecar.nodeId}\nmax_procs: 1 # 限制一个CPU核心,避免过多抢占业务资源\n\nfilebeat.inputs:\n- input_type: log\n  paths:\n    - /var/log/*.log # 日志路径,可以配置多个\n  type: log\n # multiline为多行日志合并,Java类型日志需要配置,其他日志不能使用以下规则,含义:不是以时间开头的都追加到上一条日志后边\n  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'\n  multiline.negate: true\n  multiline.match: after\n  multiline.max_lines: 200  #单一多行匹配聚合的最大行数,超过定义行数后的行会被丢弃,默认500\n  multiline.timeout: 2s     # 超时时间后,即使还未匹配到下一个行日志(下一个多行事件),也将此次匹配的事件刷出 (默认5s)\n  ignore_older: 1h      # 忽略这个时间之前的文件(根据文件改变时间)\n  fields: # 用于对日志进行分类处理,需要与运维系统中配置保持一致\n   app_name: xxxx # 应用名称\n   environment: pre #环境  pro  pre\n   log_type: Java # 日志类型 Java  Nginx\noutput.logstash:\n   hosts: [\"10.0.107.158:5044\"] # graylog服务端IP和端口,默认端口为5044\npath:\n  data: /var/lib/graylog-sidecar/collectors/filebeat/data\n  logs: /var/lib/graylog-sidecar/collectors/filebeat/log"
}
参数名示例值参数类型是否必填参数描述
namereteString名称
color#FFFFFFString颜色
collector_id636b175a1e21d174a6cf84dfString收集器Id,
template# Needed for Graylogfields_under_root: truefields.collector_node_id: ${sidecar.nodeName}fields.gl2_source_collector: ${sidecar.nodeId}max_procs: 1 # 限制一个CPU核心,避免过多抢占业务资源filebeat.inputs:- input_type: log paths: - /var/log/*.log # 日志路径,可以配置多个 type: log # multiline为多行日志合并,Java类型日志需要配置,其他日志不能使用以下规则,含义:不是以时间开头的都追加到上一条日志后边 multiline.pattern: ‘1{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}’ multiline.negate: true multiline.match: after multiline.max_lines: 200 #单一多行匹配聚合的最大行数,超过定义行数后的行会被丢弃,默认500 multiline.timeout: 2s # 超时时间后,即使还未匹配到下一个行日志(下一个多行事件),也将此次匹配的事件刷出 (默认5s) ignore_older: 1h # 忽略这个时间之前的文件(根据文件改变时间) fields: # 用于对日志进行分类处理,需要与运维系统中配置保持一致 app_name: xxxx # 应用名称 environment: pre #环境 pro pre log_type: Java # 日志类型 Java Nginxoutput.logstash: hosts: [“10.0.107.158:5044”] # graylog服务端IP和端口,默认端口为5044path: data: /var/lib/graylog-sidecar/collectors/filebeat/data logs: /var/lib/graylog-sidecar/collectors/filebeat/logString-
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/sidecar/更新sidecar-cofiguration配置

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/sidecar/configurations/:sidecarId

请求方式

PUT

Content-Type

json

路径变量
参数名示例值参数描述
sidecarId6391875642828a77d7918c9d-
请求Body参数
{
	"id": "6391875642828a77d7918c9d",
	"name": "testest",
	"color": "#FFFFFF",
	"collector_id": "636b175a1e21d174a6cf84df",
	"template": "# Needed for Graylog\nfields_under_root: true\nfields.collector_node_id: ${sidecar.nodeName}\nfields.gl2_source_collector: ${sidecar.nodeId}\nmax_procs: 1 # 限制一个CPU核心,避免过多抢占业务资源\n\nfilebeat.inputs:\n- input_type: log\n  paths:\n    - /var/log/*.log # 日志路径,可以配置多个\n  type: log\n # multiline为多行日志合并,Java类型日志需要配置,其他日志不能使用以下规则,含义:不是以时间开头的都追加到上一条日志后边\n  multiline.pattern: '^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}.[0-9]{3}'\n  multiline.negate: true\n  multiline.match: after\n  multiline.max_lines: 200  #单一多行匹配聚合的最大行数,超过定义行数后的行会被丢弃,默认500\n  multiline.timeout: 2s     # 超时时间后,即使还未匹配到下一个行日志(下一个多行事件),也将此次匹配的事件刷出 (默认5s)\n  ignore_older: 1h      # 忽略这个时间之前的文件(根据文件改变时间)\n  fields: # 用于对日志进行分类处理,需要与运维系统中配置保持一致\n   app_name: xxxx # 应用名称\n   environment: pre #环境  pro  pre\n   log_type: Java # 日志类型 Java  Nginx\noutput.logstash:\n   hosts: [\"10.0.107.158:5044\"] # graylog服务端IP和端口,默认端口为5044\npath:\n  data: /var/lib/graylog-sidecar/collectors/filebeat/data\n  logs: /var/lib/graylog-sidecar/collectors/filebeat/log"
}
认证方式
noauth
预执行脚本
暂无预执行脚本
后执行脚本
暂无后执行脚本

/graylog/sidecar/下发配置、解除配置

暂无描述
接口状态

开发中

接口URL

10.0.107.158:9000/api/sidecars/configurations

请求方式

PUT

Content-Type

json

请求Body参数
{
	"nodes": [
		{
			"node_id": "4b9d051d-edbd-4e08-aa5b-2e74da0c5076",
			"assignments": [
				{
					"collector_id": "636b175a1e21d174a6cf84df",
					"configuration_id": "6391875642828a77d7918c9d"
				}
			]
		}
	]
}
参数名示例值参数类型是否必填参数描述
nodes-Array-
nodes.node_id4b9d051d-edbd-4e08-aa5b-2e74da0c5076Stringnode_id
nodes.assignments-Object-
nodes.assignments.collector_id636b175a1e21d174a6cf84dfString收集器Id,模板
nodes.assignments.configuration_id6391875642828a77d7918c9dString配置id

  1. 0-9 ↩︎

  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值