https://github.com/nktks/cloud-logging-exporter
Cloud Logging exporter agent for files, stdin
https://github.com/nktks/cloud-logging-exporter
cloudlogging googlecloud
Last synced: 3 months ago
JSON representation
Cloud Logging exporter agent for files, stdin
- Host: GitHub
- URL: https://github.com/nktks/cloud-logging-exporter
- Owner: nktks
- Created: 2022-05-10T01:59:20.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-06T14:18:35.000Z (almost 3 years ago)
- Last Synced: 2025-01-12T18:52:11.522Z (4 months ago)
- Topics: cloudlogging, googlecloud
- Language: Go
- Homepage:
- Size: 31.3 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cloud-logging-exporter
`cloud-logging-exporter` is a command line agent tool to export file or stdin contents to Cloud Logging.# Install
```
go install github.com/nktks/cloud-logging-exporter/cmd/cloud-logging-exporter@latest
```# Usage
```
./cloud-logging-exporter -h
Usage of ./cloud-logging-exporter:
-file string
target file path for export
-logname string
log name for Cloud Logging (default "cloud-logging-exporter")
-logstdout
whether print log with stdout.
-project string
GCP project
-saved
export saved contents of file.
-severity string
log severity(default|debug|info|notice|warning|error|critical|alert|emergency) (default "info")
-touch
touch file if not exists.
```
You needs `GOOGLE_APPLICATION_CREDENTIALS` environment variables to authenticate Google Cloud.
And authenticated user needs `roles/logging.logWriter` role.You can export stdin as below execution.
```
tail -f /path/to/file | ./cloud-logging-exporter
```