|
|
|
@ -84,6 +84,27 @@ export function getOperationDefintions(): QueryBuilderOperationDef[] { |
|
|
|
|
[Read the docs](https://grafana.com/docs/loki/latest/logql/log_queries/#line-format-expression) for more.
|
|
|
|
|
`,
|
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: LokiOperationId.LabelFormat, |
|
|
|
|
name: 'Label format', |
|
|
|
|
params: [ |
|
|
|
|
{ name: 'Label', type: 'string' }, |
|
|
|
|
{ name: 'Rename', type: 'string' }, |
|
|
|
|
], |
|
|
|
|
defaultParams: ['', ''], |
|
|
|
|
alternativesKey: 'format', |
|
|
|
|
category: LokiVisualQueryOperationCategory.Formats, |
|
|
|
|
orderRank: LokiOperationOrder.LineFormats, |
|
|
|
|
renderer: (model, def, innerExpr) => `${innerExpr} | label_format ${model.params[1]}=\`${model.params[0]}\``, |
|
|
|
|
addOperationHandler: addLokiOperation, |
|
|
|
|
explainHandler: () => |
|
|
|
|
`This will change name of label to desired new label. In the example below, label "error_level" will be renamed to "level".
|
|
|
|
|
|
|
|
|
|
Example: error_level=\`level\` |
|
|
|
|
|
|
|
|
|
[Read the docs](https://grafana.com/docs/loki/latest/logql/log_queries/#labels-format-expression) for more.
|
|
|
|
|
`,
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
{ |
|
|
|
|
id: LokiOperationId.LineContains, |
|
|
|
|