Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 93 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ erased-serde = "=0.3.16"
serde = { version = "1.0", features = ["rc", "derive"] }
serde_json = "1.0"
serde_repr = "0.1.17"
toml = "0.9.8"

# Async and Runtime
async-trait = "0.1"
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,26 @@ curl --location --request POST 'http://localhost:8000/api/v1/ingest' \

Access the UI at [http://localhost:8000 ↗︎](http://localhost:8000). You can login to the dashboard default credentials `admin`, `admin`.

### Configure with TOML

We can keep Parseable configuration in a TOML file instead of managing dozens of environment variables. When a file named `parseable.toml` is present in the working directory, Parseable automatically loads it; you can also point to a different file via `parseable --config-file /path/to/config.toml` (or by setting `P_CONFIG_FILE`).

Example:

```toml
# parseable.toml
storage = "s3-store"

[env]
P_S3_URL = "https://s3.amazonaws.com"
P_S3_REGION = "us-east-1"
P_S3_BUCKET = "my-observability-bucket"
P_USERNAME = "admin"
P_PASSWORD = "super-secret"
```

Values from the TOML file are written to the corresponding `P_*` environment variables unless they are already set in the shell. Command-line flags still take precedence over everything else, so you can override individual fields without editing the file.

## Getting started :bulb:

For quickstart, refer the [quickstart section ↗︎](#quickstart-zap).
Expand Down
10 changes: 10 additions & 0 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,16 @@ Join the community at https://logg.ing/community.
subcommand_required = true,
)]
pub struct Cli {
#[arg(
long = "config-file",
short = 'c',
env = "P_CONFIG_FILE",
value_name = "path",
global = true,
value_parser = validation::file_path,
help = "Path to a TOML file containing Parseable environment defaults"
)]
pub config_file: Option<PathBuf>,
#[command(subcommand)]
pub storage: StorageOptions,
}
Expand Down
Loading
Loading