Document toolboxDocument toolbox

File Tools

[ 1 Connect File Tools with Devo SOAR ] [ 2 Actions for File Tools ] [ 2.1 Inspect File ] [ 2.1.1 Input Field ] [ 2.1.2 Output ] [ 2.2 Load .docx into a JSON Object ] [ 2.2.1 Input Field ] [ 2.2.2 Output ] [ 2.3 Load CSV into a JSON Object ] [ 2.3.1 Input Field ] [ 2.3.2 Output ] [ 2.4 Save Table as PDF ] [ 2.4.1 Input Field ] [ 2.4.2 Output ] [ 2.5 Gunzip File ] [ 2.5.1 Input Field ] [ 2.5.2 Output ] [ 2.6 Gzip File ] [ 2.6.1 Input Field ] [ 2.6.2 Output ] [ 2.7 Delete File ] [ 2.7.1 Input Field ] [ 2.7.2 Output ] [ 2.8 Get Text From PDF ] [ 2.8.1 Input Field ] [ 2.8.2 Output ] [ 2.9 Get Text From Docx ] [ 2.9.1 Input Field ] [ 2.9.2 Output ] [ 3 Release Notes ]

Manipulating files through the file integrations API.

Connect File Tools with Devo SOAR

  1. Navigate to Automations > Integrations.

  2. Search for File Tools.

  3. Click Details, then the + icon. Enter the required information in the following fields.

  4. Label: Enter a connection name.

  5. Reference Values: Define variables here to templatize integration connections and actions. For example, you can use https://www.{{hostname}}.com where, hostname is a variable defined in this input. For more information on how to add data, see 'Add Data' Input Type for Integrations.

  6. Verify SSL: Select option to verify connecting server's SSL certificate (Default is Verify SSL Certificate).

  7. Remote Agent: Run this integration using the Devo SOAR Remote Agent.

  8. After you've entered all the details, click Connect.

Actions for File Tools

Inspect File

Inspect the file and returns its MD5, SHA-1 & SHA-256 hashes, size, and MIME type.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Input Name

Description

Required

Filename Column Name

Name of the column containing the file to inspect.

Required

Output

A JSON object containing multiple rows of result:

  • has_error: True/False

  • error: message/null

  • result: A JSON with the md5 hash, the size in bytes, and the mime-type of the file.

Load .docx into a JSON Object

Load DOCX into JSON.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Input Name

Description

Required

Filename Column Name

A filename pointing to a .docx archive.

Required

Output

A JSON object containing multiple rows of result:

  • has_error: True/False

  • error: message/null

  • result: The content of the main xml document.

Load CSV into a JSON Object

Load CSV into JSON.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Input Name

Description

Required

Filename Column Name

Name of the column containing the filename/lhub_file_id to load.

Required

Header Names

If a CSV file will not have headers, provide a comma-separated list of headers to use.

Optional

Columns to Keep

If you only need specific columns, provide a comma-separated list of column names and the rest will be dropped from the results.

Optional

Output

A JSON object containing multiple rows of result:

  • has_error: True/False

  • error: message/null

  • result: The content of the csv file.

Save Table as PDF

Save data of parent table into a PDF file.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Input Name

Description

Required

Document Title

Title of PDF Document positioned at top center. Position can be customized using the Additional Options input below.

Optional

Header Row

Provide an HTML table row item (maybe with custom HTML formatting) representing a header row. You can also provide a comma-separated list of headers to use (Default is parent table headers without any special HTML formatting).

 

Example: <tr><th>Column 1</th><th>Column 2</th><th>Column 3</th></tr>

Optional

 

Table Style Definitions

Table style definition.

 

Example: CSS stylings such as borders and padding.

Optional

 

@import url('https://fonts.googleapis.com/css?family=Lato:400,700'); table { border-collapse: collapse; font-family: 'Lato'; font-weight: 400; } table th, table td { padding: 8px; } table th { font-weight: 700; }

Input Name

Description

Required

Input Name

Description

Required

Per Row Template

Jinja templated HTML definition for each row. (Default is <tr><td>{{col1}}</td><td>{{col2}}</td><td>{{col3}}</td></tr>). Nested table is supported using <lhub_json_table> custom tag as: <tr><td><lhub_json_table>{{json_column}}</lhub_json_table></td></tr>. You can also use hidden columns like lhub_id or lhub_page_num here (provide it templated as {{lhub_id}}).

Required

``` {html}{{label}}{{panel2}}{{event_count}}{{report_order}}{{events}}{{lhub_id}}

| Input Name | Description | Required | | : -------- | : -------- | : -------- | | Orientation | Select Orientation Landscape/Portrait of the final PDF document. (Default is Portrait) | Optional | | Additional Options | JSON containing options like margin-bottom, margin-left, page-size (page-height or page-width for more fine grained control on page-size) for PDF. You can specify all [wkhtmltopdf options](https://wkhtmltopdf.org/usage/wkhtmltopdf.txt). You can drop '--' in option name. If option without value, use None, False or '' for dict value. | Optional | - Orientation (Optional): Select Orientation Landscape/Portrait of the final PDF document. (Default is Portrait) - Additional Options (Optional): JSON containing options like margin-bottom, margin-left, page-size (page-height or page-width for more fine grained control on page-size) for PDF. You can specify all [wkhtmltopdf options](https://wkhtmltopdf.org/usage/wkhtmltopdf.txt). You can drop '--' in option name. If option without value, use None, False or '' for dict value. ``` {json}{ "page-size": "Letter", "margin-top": "0.75in", "margin-right": "0.75in", "margin-bottom": "0.75in", "margin-left": "0.75in", "encoding": "UTF-8", "no-outline": null }

Output

A JSON object containing multiple rows of result:

  • has_error: True/False

  • error: message/null

  • lhub_file_id: Devo SOAR File ID of PDF file.

``` {json}{ "has_error": false, "error": null, "lhub_file_id": "828f3c0063554d0395e9ed6cd8920314.pdf" }

![](https://files.readme.io/a12653e-Screenshot_2020-10-30_at_10.35.26_AM.png "Screenshot 2020-10-30 at 10.35.26 AM.png") ## Save Table into CSV Save data of table into a CSV file. ### Input Field Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection. | Input Name | Description | Required | | :-------------------- | :-------------------------------------------------------------------------------------------------------------------------------- | :------- | | Include Hidden Fields | Include Devo SOAR hidden columns in the CSV output (default is True). | Required | | Row Limit | Maximum number of rows to process. Warning: Exceeding the default of 100000 for very large tables can impact overall performance. | Required | ### Output A JSON object containing multiple rows of result: - has_error: True/False - error: message/null - result: File ID ![](https://files.readme.io/e5dd799-Save_Table_into_CSV.png "Save Table into CSV.png") ## Parse EML/MSG File as Email Parse an EML or MSG file and extract its contents. ### Input Field Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection. | Input Name | Description | Required | | :------------------- | :-------------------------------------------------- | :------- | | Filename Column Name | Name of the column containing the filename to load. | Required | ### Output A JSON object containing multiple rows of result: - has_error: True/False - error: message/null - result: Result in JSON format. ![](https://files.readme.io/eef89ee-Parse_an_EML.png "Parse an EML.png") ## Read Text File Read the contents of a text file. ### Input Field Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection. | Input Name | Description | Required | | :------------------- | :-------------------------------------------------- | :------- | | Filename Column Name | Name of the column containing the filename to load. | Required | ### Output A JSON object containing multiple rows of result: - has_error: True/False - error: message/null - result: Content of file. ![](https://files.readme.io/de143b4-Read_Text_File.png "Read Text File.png") ## Download URL (Deprecated) Download an URL and return the resulting file ID. ### Input Field Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection. | Input Name | Description | Required | | :-------------- | :-------------------------------------------------------------------- | :------- | | URL Column Name | The name of the column with the URLs that you would like to download. | Required | ### Output A JSON object containing multiple rows of result: - has_error: True/False - error: message/null - result: File ID ![](https://files.readme.io/29c6cae-Download_URL.png "Download URL.png") ## Download URL Download an URL and return the resulting file id ### Input Field Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection. | Input Name | Description | Required | | :------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------- | | URL | Jinja Templated text containing the URL that you would like to download | Required | | Custom Header | Jinja Templated text containing the custom header's value E.g : { "User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1" } | Optional | ### Output JSON containing the following items: ``` {json}{ "url":"https://lhub-qe-data.s3.us-east-2.amazonaws.com/integrationsData/virusData.csv", "has_error":false, "file_id":"6c94bf3a10be406ca00af680324cda96", "error":null }

Gunzip File

Gunzip a .gz file.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Input Name

Description

Required

Filename Column Name

Name of the column containing the filename to Gunzip.

Required

Output

A JSON object containing multiple rows of result:

  • has_error: True/False

  • error: message/null

  • result: File ID

Gzip File

Gzip a file.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Input Name

Description

Required

Filename Column Name

Name of the column containing the filename to Gzip.

Required

Output

A JSON object containing multiple rows of result:

  • has_error: True/False

  • error: message/null

  • result: File ID

Delete File

Delete the file by ID.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Input Name

Description

Required

File Id Column Name

Column name from parent table that contains the ID of the file to delete.

Required

Output

A JSON object containing multiple rows of result:

  • has_error: True/False

  • error: message/null

  • result: Success/Failure

Get Text From PDF

Get the first 50,000 characters of text in the PDF file.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Input Name

Description

Required

File ID Column Name

Column name from parent table that contains the ID of the file to read.

Required

Output

A JSON object containing multiple rows of result:

  • has_error: True/False

  • error: message/null

  • result: Text from PDF file.

Get Text From Docx

Get the first 50,000 characters of text in the docx file.

Input Field

Choose a connection that you have previously created and then fill in the necessary information in the following input fields to complete the connection.

Input Name

Description

Required

Input Name

Description

Required

File Id Column Name

Column name from parent table that contains the ID of the file to read.

Required

Output

A JSON object containing multiple rows of result:

  • has_error: True/False

  • error: message/null

  • result: Text from docx file.

Release Notes

  • v3.0.9 - Updated Action Download URL to support usage of Custom headers while downloading.

  • v3.0.0 - Updated architecture to support IO via filesystem

  • v2.0.7 - Bug resolved in action Parse EML/MSG File as Email for URL pattern recognition.

  • v1.6.23 - Description changed in action Parse EML/MSG File as Email for input Name of the column containing the file Id to load.

  • v1.6.22 - Bug resolved in action Parse EML/MSG File as Email for encoding.

  • v1.6.21 - Bug resolved for file's data decode for invalid start byte.

  • v1.6.20 - Bug resolved for filename.

  • v1.6.19 - Bug resolved for JosnDecode.