Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement commands index template creation #82

Closed
wants to merge 32 commits into from

Conversation

AlexRuiz7
Copy link
Member

@AlexRuiz7 AlexRuiz7 commented Sep 30, 2024

Description

This PR implements the creation of the command's index template before indexing data to the index.

curl -XPOST "http://127.0.0.1:9200/_plugins/_commandmanager" -H 'Content-Type: application/json' -d'
{
  "command": {
    "source": "UsersServices",
    "user": "user13",
    "target": "WazuhServerCluster5",
    "type": "agent_group",
    "action": {
        "type": "Server cluster",
        "args": [
            "/path/to/executable/arg8"
        ],
        "version": "v4"
    },
    "timeout": 100
  }
}'

{"_index":".commands","_id":"Ez2tQ5IBwhioaNePRF5F","result":"CREATED"}% 
{
  ".commands": {
    "aliases": {

    },
    "mappings": {
      "date_detection": false,
      "properties": {
        "command": {
          "properties": {
            "action": {
              "properties": {
                "args": {
                  "type": "keyword",
                  "ignore_above": 1024
                },
                "type": {
                  "type": "keyword",
                  "ignore_above": 1024
                },
                "version": {
                  "type": "keyword",
                  "ignore_above": 1024
                }
              }
            },
            "order_id": {
              "type": "keyword",
              "ignore_above": 1024
            },
            "request_id": {
              "type": "keyword",
              "ignore_above": 1024
            },
            "result": {
              "properties": {
                "code": {
                  "type": "short"
                },
                "data": {
                  "type": "keyword",
                  "ignore_above": 1024
                },
                "message": {
                  "type": "keyword",
                  "ignore_above": 1024
                }
              }
            },
            "source": {
              "type": "keyword",
              "ignore_above": 1024
            },
            "status": {
              "type": "keyword",
              "ignore_above": 1024
            },
            "target": {
              "type": "keyword",
              "ignore_above": 1024
            },
            "timeout": {
              "type": "short"
            },
            "type": {
              "type": "keyword",
              "ignore_above": 1024
            },
            "user": {
              "type": "keyword",
              "ignore_above": 1024
            }
          }
        }
      }
    },
    "settings": {
      "index": {
        "replication": {
          "type": "DOCUMENT"
        },
        "refresh_interval": "5s",
        "hidden": "true",
        "number_of_shards": "1",
        "provided_name": ".commands",
        "query": {
          "default_field": [
            "command.source",
            "command.target",
            "command.status",
            "command.type"
          ]
        },
        "creation_date": "1727712281860",
        "number_of_replicas": "0",
        "uuid": "_DVNVtJnQN2K64lBd-BuZw",
        "version": {
          "created": "136377827"
        }
      }
    }
  }
}

Issues Resolved

Closes #42

f-galland and others added 30 commits September 18, 2024 18:31
…/wazuh-indexer-plugins into 69-create-command-manager-endpoint
Improve endpoint response
@AlexRuiz7 AlexRuiz7 self-assigned this Sep 30, 2024
@AlexRuiz7 AlexRuiz7 requested a review from a team as a code owner September 30, 2024 15:41
@AlexRuiz7 AlexRuiz7 changed the title 42 implement commands index template creation Implement commands index template creation Sep 30, 2024
@AlexRuiz7
Copy link
Member Author

Superseded by #83.

@AlexRuiz7 AlexRuiz7 closed this Sep 30, 2024
@AlexRuiz7 AlexRuiz7 deleted the 42-implement-commands-index-template-creation branch September 30, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement commands index creation
2 participants