https://github.com/sbmueller/log-analyzer
Interview coding task performed May 2022
https://github.com/sbmueller/log-analyzer
Last synced: 21 days ago
JSON representation
Interview coding task performed May 2022
- Host: GitHub
- URL: https://github.com/sbmueller/log-analyzer
- Owner: sbmueller
- Created: 2022-08-01T18:27:11.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-08-01T18:27:28.000Z (almost 4 years ago)
- Last Synced: 2025-11-11T19:07:38.307Z (8 months ago)
- Language: Rust
- Size: 4.88 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Log Analyzer
Coding task performed May 2022 in context of an interview process.
Copyright (C) 2022 Sebastian Müller
## Task
### Log Files
The task was to implement a CLI tool that is able to parse log files.
Log files are defined as text files that contain an arbitrary number of lines
consisting of JSON objects. It is guaranteed that each JSON object has a `type`
key providing a String identifier. There might be additional arbitrary
key-value pairs in each JSON object.
Example log file:
```json
{"type": "Foo", "id": 3, "cluster": -3}
{"type": "Bar", "error": 1}
{"type": "Foo", "name": "titan", "calibration": 3.141}
```
### Output
The CLI in scope of this task should be able to output a table, providing
information on the different `type`s in the log file and the accumulated size
in bytes of each such `type`. In the example above, the output should look
similar to this:
```text
Type | Size
-----------
Foo | 93
Bar | 27
```