# Global Variables

Sling utilizes the following global environment variables to further configure the load behavior. You can simply define them in your environment, the `env.yaml` file or the `env` section in a task or replication.

<table><thead><tr><th width="295">Variable Name</th><th>Description</th></tr></thead><tbody><tr><td><code>SLING_HOME_DIR</code></td><td>The sling home directory, which contains <code>env.yaml</code>. Will use <a href="https://github.com/slingdata-io/sling-docs/blob/master/environment.md#sling-env-file-env.yaml">default</a> if not provided.</td></tr><tr><td><code>SLING_LOADED_AT_COLUMN</code></td><td>Whether to add an audit timestamp column named <code>_sling_loaded_at</code> in target object. Accepts values <code>true</code>, <code>false</code>, <code>unix</code> (for <a href="https://www.epochconverter.com/">epoch</a> integer values) or <code>timestamp</code>. <code>true</code> defaults to <code>unix</code>.</td></tr><tr><td><code>SLING_SYNCED_AT_COLUMN</code></td><td>Whether to add sync tracking columns <code>_sling_synced_at</code> (timestamp) and <code>_sling_synced_op</code> (operation type) in target object. The <code>_sling_synced_op</code> column tracks the last operation: <code>I</code> = Insert, <code>U</code> = Update, <code>D</code> = Delete (soft delete). This is useful when streaming from staging to multiple destinations to track when records were last touched. To enable, set to <code>true</code>. When enabled, <code>_sling_synced_at</code> replaces <code>_sling_deleted_at</code> for soft deletes.</td></tr><tr><td><code>SLING_STREAM_URL_COLUMN</code></td><td>If source is file, whether to add a column <code>_sling_stream_url</code> with the source file path / url in target object. To enable, set to <code>true</code>.</td></tr><tr><td><code>SLING_TIMEOUT</code></td><td>The maximum number of minutes the sling replication should run. Once reached, it will kill the process. To enable, set a number (<code>SLING_TIMEOUT=10.5</code>)</td></tr><tr><td><code>SLING_RECURSIVE_LIMIT</code></td><td>The number limit of file names to pull, when listing from cloud file systems such as S3, GCP and Azure Storage.</td></tr><tr><td><code>SLING_ROW_ID_COLUMN</code></td><td>Whether to add a column named <code>_sling_row_id</code> in the target object, which will have a random UUIDv7 value. This will be unique. To enable, set to <code>true</code>.</td></tr><tr><td><code>SLING_ROW_NUM_COLUMN</code></td><td>If source is file, whether to add a column named <code>_sling_row_num</code> in the target object, which will be the row number of the stream (incremented by record processed). To enable, set to <code>true</code>.</td></tr><tr><td><code>SLING_EXEC_ID_COLUMN</code></td><td>Whether to add a column named <code>_sling_exec_id</code> in the target object, which will have the run / execution string (a random UUIDv7 value). This will be unique per run. To enable, set to <code>true</code>.</td></tr><tr><td><code>SLING_STATE</code></td><td>The <a href="../environment#location-string">location</a> to read/write information such as incremental values. Proper input format is <code>CONN_NAME/key</code>. For example: <code>POSTGRES/sling_state.state_table</code> , <code>AWS_S3/my/folder</code> or <code>MY_SFTP/my/folder</code>.</td></tr><tr><td><code>SLING_ALLOW_EMPTY</code></td><td>This is useful to create tables / files using the stream columns structure, even if there is no data. To enable, set to <code>true</code>.</td></tr><tr><td><code>SLING_DIRECT_INSERT</code></td><td>Tells sling to insert directly into the final table (not create a temp table before). To enable, set to <code>true</code>.</td></tr><tr><td><code>SLING_THREADS</code></td><td>sets the maximum number of concurrent stream runs. Accepts an integer value, default is <code>1</code>.</td></tr><tr><td><code>SLING_RETRIES</code></td><td>sets the maximum number of retries for a failed stream run. Accepts an integer value, default is <code>0</code>.</td></tr><tr><td><code>SLING_KEEP_TEMP</code></td><td>Tells sling to keep any temporary files or tables created in the load process. To enable, set to <code>true</code></td></tr><tr><td><code>SLING_ENV_YAML</code></td><td>Provide the body of the <code>env.yaml</code> file as an environment variable.</td></tr><tr><td><code>SLING_DISABLE_TELEMETRY</code></td><td>this disables any anonymous usage reporting. These are used to improve sling. To disable, set this to <code>true</code>.</td></tr><tr><td><code>SLING_SHOW_PROGRESS</code></td><td>Whether the progress of the stream should be displayed (<code>true</code> or <code>false</code>).</td></tr><tr><td><code>SLING_LOGGING</code></td><td>How sling formats the log lines. Accepts values <code>JSON</code>, <code>NO_COLOR</code> or <code>CONSOLE</code> (default).</td></tr><tr><td><code>SLING_LOG_DIR</code></td><td>Directory for automatic date-based debug log files. When set, Sling creates a <code>sling_debug_YYYY_MM_DD.log</code> file in the specified directory and automatically cleans up old log files, keeping the latest 15. Supports <code>~</code> for home directory (e.g., <code>~/.sling/logs</code>).</td></tr><tr><td><code>SLING_SAMPLE_SIZE</code></td><td>The number of records to process in order to infer column types (especially for file sources). Default is <code>900</code>.</td></tr><tr><td><code>SLING_DUCKDB_COMPUTE</code></td><td>Whether to use DuckDB for writing to parquet files and partitioned parquet/CSV files. DuckDB provides optimized performance for these formats. To disable DuckDB compute, set to <code>false</code>. Default is <code>true</code>.</td></tr><tr><td><code>SLING_OTEL_ENDPOINT</code></td><td>The OpenTelemetry HTTP endpoint URL to export logs to (e.g., <code>http://otel.host.ip:4318/v1/logs</code>). When set, Sling will send structured logs to the specified OTLP endpoint with execution attributes including <code>project_id</code>, <code>job_id</code>, and <code>exec_id</code> if configured. Requires <a href="cli-pro">CLI Pro</a>.</td></tr><tr><td><code>SLING_PROXY</code></td><td>Route database connections through a SOCKS5 proxy. Accepts a SOCKS5 URL (e.g., <code>socks5://user:pass@host:1080</code>). To proxy a specific connection instead, set <code>proxy_url</code> in its <code>env.yaml</code> connection entry. Useful for reaching databases behind VPNs or private networks (e.g., Tailscale). Available in v1.5.9+</td></tr></tbody></table>
