Skip to main content
Skip table of contents

Convert File Format

Convert files (txt, xml, json, csv) from database to a different format and save them to the database

Implementation

System

Command Category

Basic Utility

Tags

ARTIFACT FILE

Inputs

Parameter Name

Required/Optional

Description

Sample Data

File IDs

Optional

The array of IDs of files for conversion

CODE
[
    1044,
    1050,
    1051
]

Source Table

Optional

The table name in which the files are

IR_ATCHMNT

Format

Optional

The file format to which the files will be converted

JSON

Output

Return Data

The returned result of this command. If some required parameters are not defined, this returned data could be empty. The returned result can be passed down directly to a subsequent command in playbooks.

SAMPLE DATA

JSON
Successful
Context Data

The response data from the utility command.

SAMPLE DATA

JSON
[
    {
        "FileID": "370",
        "FileName": "73841_2101132325140000---Test.json",
        "MD5": "b0778a411c26f7b9b9ef5db8ed99566e",
        "SHA1": "62678242ac69a2fb5cfa6a2cc3256fd8229fd7f4",
        "SHA256": "2afa7715181f03b6fe5acd7c82b8e818303a5de567af1a83d8c283010af2db44",
        "originalFileID": "1044"
    },
    {
        "FileID": "377",
        "FileName": "84403_2103252109470000---Test.json",
        "MD5": "638c10c0494fbefdef861e702b737a52",
        "SHA1": "b1e4daeef920ae36a374619dc19db6d8e43ea2a0",
        "SHA256": "8e11ef2a631ca5d0fc00753431ffb3511bff32d65816e98a66d298f0e2f2189b",
        "originalFileID": "1050"
    },
    {
        "FileID": "388",
        "FileName": "84403_2103252116120000---Test.json",
        "MD5": "d0073ab01e38cd4ded6b37fe8bcd9b74",
        "SHA1": "146ae75107cd7927870c35ea149ce9ca770d2aa6",
        "SHA256": "8078f2d8556e8c0d00429589fa75298544f96776cac63d99f2be1a8aa4cac00a",
        "originalFileID": "1051"
    }
]

Remote Command API

The D3 command API allows you to send requests to D3 SOAR to execute this utility command via REST API.

Request

POST

CODE
https:/{base_url}/{api_namespace}/api/Command/FileFormatConvert

Headers

Please refer to the page Webhook Configuration Guide - Authentication Method: API Keys for more details.

Request Body

JSON
{
  "Username": <Username here>,
  "Site": <Site here>,
  "CommandParams": {
    "File IDs": <The array of IDs of files for conversion>,
    "Source Table": <The table name in which the files are>,
    "Format": <The file format to which the files will be converted>
  }
}

Body Parameters

Parameter Name

Type

Required/Optional

Description

Username

String

Required

The username of your D3 SOAR account.

Site

String

Required

The D3 SOAR site to run the remote command.

File IDs

Text Array

Optional

The array of IDs of files for conversion

Source Table

Text

Optional

The table name in which the files are

Format

Text

Optional

The file format to which the files will be converted

Sample Request

SAMPLE DATA

JSON
{
  "Username": "Admin",
  "Site": "Security Operations",
  "CommandParams": {
    "File IDs": [
      1044,
      1050,
      1051
    ],
    "Source Table": "IR_ATCHMNT",
    "Format": "JSON"
  }
}

Response

Response Fields

Field Name

Type

Description

error

String

The error message if the API request has failed.

keyFields

String

The key fields from the API request.

returnData

Text

The return data from the API request.

contextData

JSON Array

The context data from the API request.

Sample Response

JSON
{
    "error": "",
    "keyFields": "",
    "returnData": "Successful",
    "contextData": [
    {
        "FileID": "370",
        "FileName": "73841_2101132325140000---Test.json",
        "MD5": "b0778a411c26f7b9b9ef5db8ed99566e",
        "SHA1": "62678242ac69a2fb5cfa6a2cc3256fd8229fd7f4",
        "SHA256": "2afa7715181f03b6fe5acd7c82b8e818303a5de567af1a83d8c283010af2db44",
        "originalFileID": "1044"
    },
    {
        "FileID": "377",
        "FileName": "84403_2103252109470000---Test.json",
        "MD5": "638c10c0494fbefdef861e702b737a52",
        "SHA1": "b1e4daeef920ae36a374619dc19db6d8e43ea2a0",
        "SHA256": "8e11ef2a631ca5d0fc00753431ffb3511bff32d65816e98a66d298f0e2f2189b",
        "originalFileID": "1050"
    },
    {
        "FileID": "388",
        "FileName": "84403_2103252116120000---Test.json",
        "MD5": "d0073ab01e38cd4ded6b37fe8bcd9b74",
        "SHA1": "146ae75107cd7927870c35ea149ce9ca770d2aa6",
        "SHA256": "8078f2d8556e8c0d00429589fa75298544f96776cac63d99f2be1a8aa4cac00a",
        "originalFileID": "1051"
    }
  ]
}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.