Skip to content

outscale/osc-logs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

53 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osc-logs

Project Incubating

Logs Icon


Warning

This project is currently being integrated into octl. As a result, osc-logs may soon be deprecated and will no longer receive active development. We recommend using octl for new integrations when the equivalent functionality becomes available.

🌐 Links


📄 Table of Contents


🧭 Overview

osc-logs is a lightweight command-line utility that continuously fetches and prints API call logs from your OUTSCALE account.

By default, logs are displayed as line-delimited JSON to standard output, starting from the program’s execution time.


✅ Requirements

  • Go 1.23+ (only for manual build)
  • OUTSCALE credentials configured in ~/.osc/config.json
  • Internet access to query the OUTSCALE API

⚙️ Installation

Option 1: Download Binary

Download the latest release for your platform from the GitHub Releases page.

Option 2: Install via go install

go install github.com/outscale/osc-logs@latest

🛠 Configuration

The tool uses the following file to authenticate:

~/.osc/config.json

Example config.json

{
  "default": {
    "access_key": "MyAccessKey",
    "secret_key": "MySecretKey",
    "region": "eu-west-2"
  }
}

🚀 Usage

osc-logs [OPTIONS]

Options

Option Description
-w, --write Write all traces to a file instead of stdout
-c, --count Exit after <count> logs
-i, --interval Wait <wait> seconds between API calls (default: 10)
-p, --profile Use a specific config profile (default: "default")
-I, --ignore Ignore specific API calls (comma-separated)
-v, --version Print version and exit

Ignored calls default to ReadApiLogs. Example: --ignore=ReadApiLogs,ReadVms


💡 Examples

Write all logs to a file

osc-logs -w logs.json

View logs in real-time

tail -f logs.json

Filter and format using jq

Show only date, operation name, and status code in TSV format:

jq -s -r '(.[] | [.QueryDate, .QueryCallName, .ResponseStatusCode]) | @tsv' logs.json

Sample output:

2022-06-17T12:14:28.378111Z	ReadVolumes	200
2022-06-17T12:14:30.379899Z	CreateVms	200

📜 License

osc-logs is released under the BSD 3-Clause License. © 2024 Outscale SAS

See LICENSE for details.


🤝 Contributing

See CONTRIBUTING.md for guidelines on how to contribute or run tests.

Releases

Used by

Contributors

Languages