- What Grafana version and what operating system are you using?
Ubuntu server 24.04, Grafana grafana version 11.3.0+security-01 - What are you trying to achieve?
I want to cut part of path to log file.
/nginx_log/access.log
/nginx_log/error.log
/site_logs/laravel.log
- How are you trying to achieve it?
I tried any regexp in grafana dashboard variable. - What happened?
I can’t receive only filename in path string - What did you expect to happen?
I want receive if it possible only filename
access.log
error.log
laravel.log
- Can you copy/paste the configuration(s) that you are having problems with?
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 14,
"links": [],
"panels": [
{
"datasource": {
"type": "loki",
"uid": "ae3uqu262e96od"
},
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 17,
"w": 24,
"x": 0,
"y": 0
},
"id": 1,
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": true,
"showCommonLabels": false,
"showLabels": false,
"showTime": true,
"sortOrder": "Ascending",
"wrapLogMessage": true
},
"pluginVersion": "11.3.0+security-01",
"targets": [
{
"datasource": {
"type": "loki",
"uid": "ae3uqu262e96od"
},
"editorMode": "builder",
"expr": "{host=\"dev\", filename=\"$file\"} |~ `(?i)$find`",
"queryType": "range",
"refId": "A"
}
],
"title": "Frontend BETA",
"type": "logs"
}
],
"preload": false,
"schemaVersion": 40,
"tags": [],
"templating": {
"list": [
{
"current": {
"text": "/site_logs/laravel.log",
"value": "/site_logs/laravel.log"
},
"datasource": {
"type": "loki",
"uid": "ae3uqu262e96od"
},
"definition": "",
"label": "File",
"name": "file",
"options": [],
"query": {
"label": "filename",
"refId": "LokiVariableQueryEditor-VariableQuery",
"stream": "",
"type": 1
},
"refresh": 1,
"regex": "",
"type": "query"
},
{
"current": {
"text": "",
"value": ""
},
"description": "",
"label": "Find text",
"name": "find",
"options": [
{
"selected": true,
"text": "",
"value": ""
}
],
"query": "",
"type": "textbox"
}
]
},
"time": {
"from": "now-3h",
"to": "now"
},
"timepicker": {},
"timezone": "browser",
"title": "DEV Frontend",
"uid": "fe3uum3g6bgu89",
"version": 7,
"weekStart": ""
}
- Did you receive any errors in the Grafana UI or in related logs? If so, please tell us exactly what they were.
No. - Did you follow any online instructions? If so, what is the URL?
Add variables | Grafana documentation
and other regexp tools.
Is it possible?