LogsParser interface
Signature
export interface LogsParser
Import
import { LogsParser } from '@grafana/data';
Properties
Property | Type | Description |
---|---|---|
buildMatcher | (label: string) => RegExp |
Value-agnostic matcher for a field label. Used to filter rows, and first capture group contains the value. |
getFields | (line: string) => string[] |
Returns all parsable substrings from a line, used for highlighting |
getLabelFromField | (field: string) => string |
Gets the label name from a parsable substring of a line |
getValueFromField | (field: string) => string |
Gets the label value from a parsable substring of a line |
test | (line: string) => any |
Function to verify if this is a valid parser for the given line. The parser accepts the line unless it returns undefined. |
buildMatcher property
Value-agnostic matcher for a field label. Used to filter rows, and first capture group contains the value.
Signature
buildMatcher: (label: string) => RegExp;
getFields property
Returns all parsable substrings from a line, used for highlighting
Signature
getFields: (line: string) => string[];
getLabelFromField property
Gets the label name from a parsable substring of a line
Signature
getLabelFromField: (field: string) => string;
getValueFromField property
Gets the label value from a parsable substring of a line
Signature
getValueFromField: (field: string) => string;
test property
Function to verify if this is a valid parser for the given line. The parser accepts the line unless it returns undefined.
Signature
test: (line: string) => any;
Related Grafana video resources
Getting started with Grafana
Take a guided tour of Grafana and learn how to monitor a web service using Prometheus and Loki in this beginner-friendly webinar.
All about Grafana plugins: Visualizing disparate data sources in one place
Grafana Enterprise plugins are integrations with other commercial monitoring tools (such as Datadog, Splunk, New Relic, ServiceNow, Oracle, and Dynatrace) that are created, maintained, and supported by the Grafana Labs team.
Demo: Getting started with Grafana Enterprise and observability
Join the Grafana Labs team for a 30-minute demo of how to get started with the Grafana Stack, so you can go from zero to observability in just a few minutes.