This guide covers configuring the LogFlux Collector CLI to connect to your LogFlux server.
Quick Setup
After installing the CLI, initialize the configuration:
|
|
Configuration File Structure
The configuration file uses JSON format with the following structure:
|
|
Configuration Fields
Field | Required | Description | Example |
---|---|---|---|
server_url |
Yes | Your LogFlux ingest endpoint | https://c12345.ingest.us.logflux.io/v1 |
api_key |
Yes | Your LogFlux API key | lf_abcd1234efgh5678ijkl9012mnop3456 |
node_id |
Yes | Unique identifier for this client | server-01 |
secret |
Yes | Encryption secret for log data | 32-character-encryption-secret-key |
prefix |
No | Default prefix for log messages | myapp |
Server URL Format
LogFlux uses customer-specific endpoints in the format:
https://[customer-id].ingest.[region].logflux.io/v1
Examples:
https://c12345.ingest.us.logflux.io/v1
(US region)https://c12345.ingest.eu.logflux.io/v1
(EU region)https://c12345.ingest.ap.logflux.io/v1
(Asia Pacific region)
API Key Format
LogFlux API keys follow a specific format:
- Prefix: All keys start with
lf_
- Format:
lf_
followed by 32 alphanumeric characters - Example:
lf_abcd1234efgh5678ijkl9012mnop3456
Configuration Locations
The CLI looks for configuration files in the following order:
- Custom path (via
-config
flag):./logflux-collector -config /path/to/config.json
- User home directory:
~/.logflux-collector.json
- Current directory:
./logflux-collector.json
Environment Variables
You can override configuration values using environment variables:
|
|
Environment variables take precedence over configuration file values.
Security Considerations
API Key Security
- Never commit API keys to version control
- Use environment variables in production
- Rotate API keys periodically
- Store keys securely using your preferred secrets management solution
Encryption Secret
- Must be exactly 32 characters long
- Use a cryptographically secure random string
- Keep the secret secure and never share it
- Different secrets can be used for different environments
File Permissions
Secure your configuration file:
|
|
Validation
Test your configuration:
|
|
Common Issues
Invalid API Key
Error: authentication failed: invalid API key
- Verify your API key starts with
lf_
- Check that the key is exactly 32 characters after the prefix
- Ensure no extra spaces or characters
Connection Errors
Error: connection failed: dial tcp: lookup failed
- Verify your server URL is correct
- Check network connectivity
- Ensure the endpoint is accessible from your location
Encryption Errors
Error: encryption failed: invalid secret length
- Verify your secret is exactly 32 characters
- Use only alphanumeric characters and standard symbols
- Regenerate the secret if needed
Production Setup
For production deployments:
1. Use Environment Variables
|
|
2. Secure Configuration Storage
|
|
3. Monitor Configuration
|
|