MongoDB Key Value Store
MongoDB Pack.#
This Integration is part of the#
OverviewManipulates key/value pairs according to an incident utilizing the MongoDB collection. This integration was integrated and tested with version v4.2.3 of MongoDB.
The account user must have appropriate permissions - root role to execute the API calls.
#
Configure MongoDB Key Value Store on Cortex XSOAR- Navigate to Settings > Integrations > Servers & Services.
- Search for MongoDB Key Value Store.
- Click Add instance to create and configure a new integration instance.
- Name: a textual name for the integration instance.
- MongoDB username
- URI (mongodb://IP/FQDN:Port Number)
- MongoDB database name
- MongoDB collection name
- Use an SSL/TLS secured connection
- Trust any certificate (not secure)
- Click Test to validate the URLs, token, and connection.
#
CommandsYou can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.
- mongodb-write-key-value
- mongodb-get-key-value
- mongodb-list-key-values
- mongodb-delete-key
- mongodb-purge-entries
- mongodb-get-keys-number
- mongodb-list-incidents
#
1. mongodb-write-key-valueAdds a key/value record for the incident. If the key exists, the existing value is overwritten.*
#
Base Commandmongodb-write-key-value
#
InputArgument Name | Description | Required |
---|---|---|
id | The XSOAR incident number. | Optional |
key | Name/Key. | Required |
value | Assigns a value to the name/key. | Required |
#
Context OutputPath | Type | Description |
---|---|---|
MongoDB.Entry.ID | String | Entry ID. |
MongoDB.Entry.Incident | String | Incident ID. |
MongoDB.Entry.Key | String | Incident key. |
MongoDB.Entry.Value | String | Incident value. |
MongoDB.Entry.Modified | Date | Incident modified date. |
#
Command Example!mongodb-write-key-value key=demisto value=test5
#
Context Example#
Human Readable OutputIncident "6e1807d3-b0ae-40a0-8e82-dad33539c587" - key/value collection - 1 document added
#
2. mongodb-get-key-valueReturns the value of the specified name/key of an incident.
#
Base Commandmongodb-get-key-value
#
InputArgument Name | Description | Required |
---|---|---|
id | The XSOAR incident number. | Optional |
key | Name/Key. | Required |
#
Context OutputPath | Type | Description |
---|---|---|
MongoDB.Entry.Incident | String | Incident ID. |
MongoDB.Entry.Key | String | Incident key. |
MongoDB.Entry.Value | String | The value of the key. |
#
Command Example!mongodb-get-key-value key=demisto
#
Context Example#
Human Readable Output#
The key and value that is stored for the incidentIncident | Key | Modified | Value |
---|---|---|---|
6e1807d3-b0ae-40a0-8e82-dad33539c587 | demisto | 2020-04-12T09:12:42+00:00 | test5 |
#
3. mongodb-list-key-valuesLists the keys and their values for the specified incident.
#
Base Commandmongodb-list-key-values
#
InputArgument Name | Description | Required |
---|---|---|
id | The XSOAR incident number. | Optional |
#
Context OutputPath | Type | Description |
---|---|---|
MongoDB.Incident.Incident | String | Incident ID. |
MongoDB.Incident.Key | String | Incident key. |
MongoDB.Incident.Value | String | The value of the key. |
#
Command Example!mongodb-list-key-values id=1234
#
Context Example#
Human Readable Output#
The key/value paires stored in incident 1234Key | Value |
---|---|
test | test2 |
demisto | test |
hello | world |
#
4. mongodb-delete-keyDeletes the key/value record for an incident.
#
Base Commandmongodb-delete-key
#
InputArgument Name | Description | Required |
---|---|---|
id | The XSOAR incident number. | Optional |
key | Name/Key. | Required |
#
Context OutputThere is no context output for this command.
#
Command Example!mongodb-delete-key key=hello id=1234
#
Human Readable OutputIncident "1234" - key/value collection - 1 document deleted
#
5. mongodb-purge-entriesPurges all keys/values for an incident. A common use case for this command is when closing an incident. This command clears the entries for the closed incident from the database.
#
Base Commandmongodb-purge-entries
#
InputArgument Name | Description | Required |
---|---|---|
id | The XSOAR incident number. | Optional |
#
Context OutputThere is no context output for this command.
#
Command Example!mongodb-purge-entries id=2468
#
Human Readable OutputIncident "2468" key/value pairs purged - 1 document/record deleted
#
6. mongodb-get-keys-numberReturns the number of key/value pairs for an incident.
#
Base Commandmongodb-get-keys-number
#
InputArgument Name | Description | Required |
---|---|---|
id | The XSOAR incident number. | Optional |
#
Context OutputThere is no context output for this command.
#
Command Example!mongodb-get-keys-number id=1234
#
Human Readable OutputThe count of the key/value pairs for the incident - 2
#
7. mongodb-list-incidentsLists all incidents in the collection.
#
Base Commandmongodb-list-incidents
#
InputThere are no input arguments for this command.
#
Context OutputThere is no context output for this command.
#
Command Example!mongodb-list-incidents
#
Human Readable Output#
List of incidents in collecion genericIncidents |
---|
2468 |
1234 |
014f5f87-a1bf-4eac-8d36-2ec3b69693ef |
6e1807d3-b0ae-40a0-8e82-dad33539c587 |