パーサ一覧の取得
検索条件に一致するパーサの一覧を取得します。
必要な権限
ADMIN以上のロールが必要です。
HTTPリクエスト
GET /api/sonar/parsers
cURL例
curl -H "Authorization: Bearer <API_KEY>" \
https://HOSTNAME/api/sonar/parsers
リクエストパラメータ
| キー | 必須 | 型 | 説明 | 備考 |
|---|---|---|---|---|
| offset | × | 32ビット整数 | スキップする件数 | デフォルトは0 |
| limit | × | 32ビット整数 | 最大取得件数 | |
| type | × | 文字列 | パーサタイプ | parser または normalizer |
| keywords | × | 文字列 | 検索キーワード | code, nameを対象に検索 |
正常応答
{
"total_count": 27,
"parsers": [
{
"code": "fortigate",
"name": "フォーティゲート",
"description": "WELF形式のフォーティゲートログをパースします。",
"factory_name": "fortigate",
"factory_display_name": "フォーティゲート",
"builtin": true,
"configs": {
"ver": "2"
},
"created": "2022-09-01 00:31:14+0900",
"updated": "2022-09-01 00:31:14+0900"
}
]
}
- total_count (32ビット整数): 検索条件に一致する全件数
- parsers (配列): パーサ一覧
- code (文字列): パーサ識別子。parseコマンドでパーサを呼び出す際に参照されます。
- name (文字列): パーサの表示名
- description (文字列): パーサの説明
- factory_name (文字列): パーサタイプ識別子
- factory_display_name (文字列): パーサタイプの表示名
- builtin (ブール値): パッケージ内蔵パーサかどうか
- schema_code (文字列): 正規化スキーマ名。正規化パーサの場合のみ出力されます。
- schema_name (文字列): 正規化スキーマの表示名。正規化パーサの場合のみ出力されます。
- configs (マップ): パーサタイプ別設定仕様で定義された設定キー/値の一覧
- created (文字列): 作成日時。yyyy-MM-dd HH:mm:ssZ形式。
- updated (文字列): 更新日時。yyyy-MM-dd HH:mm:ssZ形式。
エラー応答
不正なパーサタイプを指定した場合
{
"error_code": "invalid-argument",
"error_msg": "type should be 'parser' or 'normalizer': unknown"
}
offsetまたはlimitの値が整数でない場合
HTTPステータスコード 400 応答
{
"error_code": "invalid-argument",
"error_msg": "'offset' parameter should be int type"
}
offsetまたはlimitの値が負の場合
HTTPステータスコード 400 応答
{
"error_code": "invalid-argument",
"error_msg": "'offset' must be greater than or equal to 0."
}