Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lmangani/vpipe
experimental log parser in v
https://github.com/lmangani/vpipe
chain cloki experimental json logfmt logs parse pipe regex v vlang
Last synced: 9 days ago
JSON representation
experimental log parser in v
- Host: GitHub
- URL: https://github.com/lmangani/vpipe
- Owner: lmangani
- License: mit
- Created: 2022-03-27T23:49:59.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-08-25T22:24:24.000Z (over 2 years ago)
- Last Synced: 2024-10-04T13:22:00.401Z (3 months ago)
- Topics: chain, cloki, experimental, json, logfmt, logs, parse, pipe, regex, v, vlang
- Language: V
- Homepage:
- Size: 33.2 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![vlang-build-pipeline](https://github.com/lmangani/vpipe/actions/workflows/v.yml/badge.svg)](https://github.com/lmangani/vpipe/actions/workflows/v.yml)
# vpipe
experimental log pipeline chain parser in [vlang](https://vlang.io/)#### Status
* Experimental, Hackish, Amateurish. Do _NOT_ use this. 💣### Parsers
- [x] logfmt
- [x] json
- [x] regex### Dummy Functions
- [x] count()
- [x] avg()### Usage
##### logfmt
```bash
echo "some=logs are=boring" | vpipe 'logfmt'{ "some": "logs", "are": "boring" }
```
##### logfmt + json
```bash
echo "some=logs are=boring counter=100" | vpipe 'logfmt | json counter'100
```
##### regex
```bash
echo 'http://www.ciao.mondo/pera.html' \
| vpipe 'regex (?Phttps?)|(?Pftps?)://(?P[\w_]+.)+'{"format":"http","token":"html"}
```#### 🕐 Benchmark
##### vpipe
```
# hyperfine --warmup 3 'cat /tmp/test.log | vpipe "logfmt"'
Benchmark 1: cat /tmp/test.log | vpipe "logfmt"
Time (mean ± σ): 1.3 ms ± 0.1 ms [User: 1.8 ms, System: 0.5 ms]
Range (min … max): 1.1 ms … 1.7 ms 1428 runs
```
##### angle-grinder
```
# hyperfine --warmup 3 "cat /tmp/test.log | ag '* | logfmt'"
Benchmark 1: cat /tmp/test.log | agrind '* | logfmt'
Time (mean ± σ): 4.5 ms ± 0.2 ms [User: 2.4 ms, System: 3.2 ms]
Range (min … max): 1.8 ms … 4.9 ms 544 runs
```