SFTP

SFTP (SSH File Transfer Protocol) is a widely accepted method for secure file transmission between two or more computers. SFTP uses a client and an SSH server to operate. The client authorizes with the SSH server before transmitting the data thus ensuring security and secrecy of the files.

Connecting to SFTP

Mammoth supports data imports via SFTP. When connecting to your SFTP client, you can choose between a password-based authentication or an SSH key based authentication as mentioned in the documentation.

Via Username & Password

This is how you can connect to your SFTP client using an username and a password:

  1. Login to Mammoth.

  2. Click on Add data button at the top-right section and select API & Databases.

  3. Choose SFTP from the list.

  1. Click to create a New Connection, select User & password, and authenticate.

Via SSH key

Follow these steps to connect via an SSH key:

  1. Login to Mammoth.

  2. Click on Add data button at the top-right section and select API & Databases.

  3. Choose SFTP from the list.

  1. Click to create a New Connection and connect via SSH key.

  1. Fill in the credentials and generate an SSH key.

  1. Copy the generated SSH key and paste it in the SFTP server to finish the authentication.

SSH key

Fig. 75 Copy SSH key

The system generates an SSH key pair. Only the public key is available for copying, while the private key resides in Mammoth for verification while establishing a connection.

Note

An SSH connection is validated and established only after you click on the created identity.

Importing files from SFTP

After establishing the connection, follow these steps to import files into Mammoth:

  1. Choose the account.

Select the account

Fig. 76 Choosing the Account.

  1. Select the file, pull type, etc.

Mammoth offers two types of data pull options:

  • Pull same file: This option retrieves latest data from the same file as per the specified schedule.

  • Pull next file based on name pattern: This option follows a pattern to find the next file in the series and pulls data from that file on latest data retrieval or scheduled pulls.

Scheduling data imports in SFTP

Once you have selected the file and pull type, schedule your future data imports like this:

Once you’ve done this, your Dataset will appear in the Data library.

Defining file pattern in SFTP

Suppose you have a file named data 01-jul-22 12:45:03 pm. The pattern to fetch the next file in this series would be data <dd>-<mon>-<yy> <hh>:<mi>:<ss> <pm>.

You can refer to this table to create different patterns:

Table 1 Data Patterns

Pattern Symbol

Description

Value

Example file

Example pattern

<dd>

date

00 to 31

For a file named November-12-2022

The pattern will be November-<dd>-<yyyy>

<dy>

day

Sun, Mon, Tue, Wed, Thu, Fri, Sat

For a file named Mon 12-07-2022

The pattern will be <dy> <dd>-<mm>-<yyyy>

<day>

day

Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday

For a file named Monday 12-07-2022

The pattern will be <day> <dd>-<mm>-<yyyy>

<w>

day

0-6, (0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday)

For a file named 01 12-12-2022

The pattern will be <w> <dd>-<mm>-<yyyy>

<mm>

month

01-12

For a file December 01, the pattern will be <month> <w>

<mon>

month

Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec

For a file JUL 12-07-2022

The pattern will be <mon> <dd>-<mm>-<yyyy>

<month>

month

January, February, March, April, May, June, July, August, September, Ooctober, November, December

For a file JULY 12-07-2022

The pattern will be <month> <dd>-<mm>-<yyyy>

<yy>

year

00-99

For a file JUL 22

The pattern will be <mon> <yy>

<yyyy>

year

1000-9999

For a file JUL 2022

The pattern will be <mon> <yyyy>

<hh>

year

00-12

For a file JUL 12-07-2022 02:30:13 am

The pattern will be <mon> <dd>-<mm>-<yyyy> <hh>:<mi>:<ss> <am>

<hh12>

hour

00-12

For a file JUL 12-07-2022 08:45:15 pm

The pattern will be <mon> <dd>-<mm>-<yyyy> <hh>:<mi>:<ss> <am>

<hh24>

hour

00-24

For a file JUL 12-07-2022 21:45:15

The pattern will be <mon> <dd>-<mm>-<yyyy> <hh>:<mi>:<ss>

<mi>

minutes

00-59

Check examples above

<ss>

seconds

00-59

Check examples above

<am>

AM

am

Check examples above

<pm>

PM

pm

Check examples above

Options

Mammoth also offers a bunch of options to manage your SFTP integration and Dataset.

These are:

  1. Edit Connection: You can use this option to make changes to the account settings.

  2. Retrieve Latest Data: You can refresh your Dataset with new data.

SFTP integration management

Fig. 77 SFTP connection management options

  1. Edit Schedule: You can make changes to the data schedule with this option.

SFTP schedule option

Fig. 78 Edit schedule option

Note

  1. The system pulls only the most recent file based on the pattern. For instance, if your SFTP client gets a new file every day but Mammoth pulls are scheduled for weekly, the system will fetch only the last file of that week. To avoid this, make sure your data pulls in Mammoth coincide with the SFTP data updates.

  2. Mammoth also supports password-protected .xlsx files via SFTP.

    password protected file upload

    Fig. 79 Importing a password protected .xlsx file