mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
renames Grafana Logging ds to Loki
This commit is contained in:
29
public/app/plugins/datasource/loki/syntax.ts
Normal file
29
public/app/plugins/datasource/loki/syntax.ts
Normal file
@@ -0,0 +1,29 @@
|
||||
/* tslint:disable max-line-length */
|
||||
|
||||
const tokenizer = {
|
||||
comment: {
|
||||
pattern: /(^|[^\n])#.*/,
|
||||
lookbehind: true,
|
||||
},
|
||||
'context-labels': {
|
||||
pattern: /(^|\s)\{[^}]*(?=})/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'label-key': {
|
||||
pattern: /[a-z_]\w*(?=\s*(=|!=|=~|!~))/,
|
||||
alias: 'attr-name',
|
||||
},
|
||||
'label-value': {
|
||||
pattern: /"(?:\\.|[^\\"])*"/,
|
||||
greedy: true,
|
||||
alias: 'attr-value',
|
||||
},
|
||||
punctuation: /[{]/,
|
||||
},
|
||||
},
|
||||
// number: /\b-?\d+((\.\d*)?([eE][+-]?\d+)?)?\b/,
|
||||
operator: new RegExp(`/&&?|\\|?\\||!=?|<(?:=>?|<|>)?|>[>=]?`, 'i'),
|
||||
punctuation: /[{}`,.]/,
|
||||
};
|
||||
|
||||
export default tokenizer;
|
||||
Reference in New Issue
Block a user