https://github.com/outscale/osc-logs
osc-logs
https://github.com/outscale/osc-logs
maturity-incubating
Last synced: 7 months ago
JSON representation
osc-logs
- Host: GitHub
- URL: https://github.com/outscale/osc-logs
- Owner: outscale
- Created: 2022-05-10T07:30:24.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-23T14:38:23.000Z (almost 3 years ago)
- Last Synced: 2025-03-21T05:43:10.102Z (11 months ago)
- Topics: maturity-incubating
- Language: Go
- Homepage:
- Size: 45.9 KB
- Stars: 3
- Watchers: 6
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSES/BSD-3-Clause.txt
Awesome Lists containing this project
README
# osc-logs
[](https://docs.outscale.com/en/userguide/Open-Source-Projects.html)
---
## π Links
* API Reference: [Outscale API Logs](https://docs.outscale.com/api#tocslog)
* Releases: [https://github.com/outscale/osc-logs/releases](https://github.com/outscale/osc-logs/releases)
* jq Utility: [https://stedolan.github.io/jq/](https://stedolan.github.io/jq/)
---
## π Table of Contents
* [Overview](#-overview)
* [Requirements](#-requirements)
* [Installation](#-installation)
* [Configuration](#-configuration)
* [Usage](#-usage)
* [Examples](#-examples)
* [License](#-license)
* [Contributing](#-contributing)
---
## π§ 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](https://github.com/outscale/osc-logs/releases).
### Option 2: Install via `go install`
```bash
go install github.com/outscale/osc-logs@latest
```
---
## π Configuration
The tool uses the following file to authenticate:
```
~/.osc/config.json
```
### Example `config.json`
```json
{
"default": {
"access_key": "MyAccessKey",
"secret_key": "MySecretKey",
"region": "eu-west-2"
}
}
```
---
## π Usage
```bash
osc-logs [OPTIONS]
```
### Options
| Option | Description |
| ---------------- | ----------------------------------------------------- |
| `-w, --write` | Write all traces to a file instead of stdout |
| `-c, --count` | Exit after `` logs |
| `-i, --interval` | 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
```bash
osc-logs -w logs.json
```
### View logs in real-time
```bash
tail -f logs.json
```
### Filter and format using `jq`
Show only date, operation name, and status code in TSV format:
```bash
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](./LICENSE) for details.
---
## π€ Contributing
See [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines on how to contribute or run tests.