Skip to main content

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.

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.

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:

Pattern SymbolDescriptionValueExample fileExample pattern
<dd>date00 to 31For a file named November-12-2022The pattern will be November-<dd>-<yyyy>
<dy>daySun, Mon, Tue, Wed, Thu, Fri, SatFor a file named Mon 12-07-2022The pattern will be <dy> <dd>-<mm>-<yyyy>
<day>daySunday, Monday, Tuesday, Wednesday, Thursday, Friday, SaturdayFor a file named Monday 12-07-2022The pattern will be <day> <dd>-<mm>-<yyyy>
<w>day0-6, (0=Sunday, 1=Monday, 2=Tuesday, 3=Wednesday, 4=Thursday, 5=Friday, 6=Saturday)For a file named 01 12-12-2022The pattern will be <w> <dd>-<mm>-<yyyy>
<mm>month01-12For a file December 01the pattern will be <month> <w>

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 connection management options

  1. Edit Schedule: You can make changes to the data schedule with this 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.

Importing a password protected .xlsx file