2.1.0 • Published 6 months ago

@sigyn/logql v2.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

🚧 Requirements

🚀 Getting Started

This package is available in the Node Package Repository and can be easily installed with npm or yarn

$ npm i @sigyn/logql
# or
$ yarn add @sigyn/logql

📚 Usage

Build your LogQL

import { LogQL } from "@sigyn/logql";

const logql = new LogQL("foo");
logql.streamSelector.set("env", "prod");
logql.lineEq("bar");
logql.lineNotEq("baz");

// {env=\"prod\"} |= `foo` |= `bar` != `baz`
console.log(logql.toString());

Parse your LogQL

import { LogQL } from "@sigyn/logql";

const logql = new LogQL("{app=\"foo\", env=\"preprod\"} |= `foo` != `bar`");

console.log([...logql.streamSelector.entries()]);
console.log(logql.lineFilters.lineContains());
console.log(logql.lineFilters.lineDoesNotContain());

🌐 API

Individual LogQL parts (used in the parent class). You can also use them individually for separate needs.

{env="staging"} |= "req-xxx" | pattern `ok: <ok>` | ok = "true" | unpack
^^^             ^^^          ^^^                  ^^^           ^
StreamSelector  LineFilters  ParserExpression     LabelFilters  ParserExpression

License

MIT

2.1.0

6 months ago

2.0.0

7 months ago

1.1.0

9 months ago

1.0.1

9 months ago

1.0.0

10 months ago