| Crates.io | qx |
| lib.rs | qx |
| version | 0.1.1 |
| created_at | 2025-04-16 20:28:33.911093+00 |
| updated_at | 2025-04-17 08:51:02.815187+00 |
| description | Eazy to use log analyzer |
| homepage | |
| repository | https://github.com/melsomino/qx |
| max_upload_size | |
| id | 1636916 |
| size | 53,377 |
Eazy to use log analyzer – good replacement for grep.
.tar.gz, tar.xy.Clone this repo. Run from repo root:
cargo install --path .
Query single log file:
$ qx -p ./logs/foo.log failed
2025-03-27T12:15:38.105089Z ERROR foo::bar: foo/src/bar.rs:61: Calculation failed a < 3
2025-03-27T12:16:08.105731Z ERROR foo::bar: foo/src/bar.rs:20: Write to DB failed: invalid column name: baz
Query all log files in dir:
$ qx -p ./logs failed
./logs/foo1.log
2025-03-27T12:15:38.105089Z ERROR foo::bar: foo/src/bar.rs:61: Calculation failed a < 3
2025-03-27T12:16:08.105731Z ERROR foo::bar: foo/src/bar.rs:20: Write to DB failed: invalid column name: baz
./logs/foo2.log
2025-03-27T12:15:38.105089Z ERROR foo::bar: foo/src/bar.rs:61: Calculation failed a < 3
2025-03-27T12:16:08.105731Z ERROR foo::bar: foo/src/bar.rs:20: Write to DB failed: invalid column name: baz
Query for all words:
$ qx -p ./logs/foo.log failed calc
2025-03-27T12:15:38.105089Z ERROR foo::bar: foo/src/bar.rs:61: Calculation failed a < 3
$ qx -p ./logs/foo.log failed db
2025-03-27T12:16:08.105731Z ERROR foo::bar: foo/src/bar.rs:20: Write to DB failed: invalid column name: baz
Query alternatives:
$ qx -p ./logs/foo.log 'failed|invalid'
2025-03-27T12:15:38.105089Z ERROR foo::bar: foo/src/bar.rs:61: Calculation failed a < 3
2025-03-27T12:16:08.105731Z ERROR foo::bar: foo/src/bar.rs:20: Invalid component index 3 (should be less than 2)
Query by whole words (by default it uses prefix):
$ qx -p ./logs/foo.log 'fail' -w
2025-03-27T12:15:38.105089Z ERROR foo::bar: foo/src/bar.rs:61: Critical fail: no room on disk
Query with important word order:
$ qx -p ./logs/foo.log 'db failed' -o
2025-03-27T12:16:08.105731Z ERROR foo::bar: foo/src/bar.rs:20: Write to DB failed: invalid column name: baz
this query skips line like:
2025-03-27T12:16:08.105731Z ERROR foo::bar: foo/src/bar.rs:20: Failed to connect to DB
If you specify path to file, qx will use specified file.
If specified file is an archive (*.tar.gz, *.tar.xz) then qx will extract all *.log files from this archive and will delete archive.
To optimize query speed qx creates index file with name "source-file-name.ix". For example, it creates file "foo.log.ix" for file "foo.log".
If specified path is a directory, qx will recursively scan directory for files *.log, *.tar.gz, *.tar.xz and will process each found file as described above.