Skip to content

nktks/cloud-logging-exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Cloud Logging exporter agent for files, stdin

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages