Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/v1.3] Update local.file.md #2112

Merged
merged 1 commit into from
Nov 15, 2024
Merged
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
10 changes: 9 additions & 1 deletion docs/sources/reference/components/local/local.file.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ Name | Type | Description
----------|----------------------|---------------------------------------------------
`content` | `string` or `secret` | The contents of the file from the most recent read

The `content` field will have the `secret` type only if the `is_secret` argument was true.
The `content` field will have the `secret` type only if the `is_secret` argument was true.

You can use `local.file.LABEL.content` to access the contents of the file.

## Component health

Expand All @@ -66,9 +68,15 @@ The read error will be exposed as a log message and in the debug information for

## Example

The following example shows a simple `local.file` configuration that watches a passwords text file and uses the exported content field.

```alloy
local.file "secret_key" {
filename = "/var/secrets/password.txt"
is_secret = true
}
grafana_cloud.stack "receivers" {
stack_name = "mystack"
token = local.file.secret_key.content
}
```
Loading