@@ -56,7 +56,33 @@ def run():
56
56
Likewise, use "GRAFANA_TOKEN" instead of "--grafana-token"
57
57
for propagating the Grafana API Key.
58
58
59
- Search examples:
59
+
60
+ General information:
61
+
62
+ # Display a bunch of meta information and statistics.
63
+ grafana-wtf info --format=yaml
64
+
65
+ # Display Grafana version.
66
+ grafana-wtf info --format=json | jq -r '.grafana.version'
67
+
68
+ Explore data sources:
69
+
70
+ # Display all data sources and the dashboards using them, as well as unused data sources.
71
+ grafana-wtf explore datasources --format=yaml
72
+
73
+ # Display names of unused datasources as a flat list.
74
+ grafana-wtf explore datasources --format=json | jq -r '.unused[].datasource.name'
75
+
76
+ Explore dashboards:
77
+
78
+ # Display some details of all dashboards, including names of missing data sources.
79
+ grafana-wtf explore dashboards --format=yaml
80
+
81
+ # Display only dashboards which have missing data sources, along with their names.
82
+ grafana-wtf explore dashboards --format=json | jq '.[] | select( .datasources_missing ) | .dashboard + {ds_missing: .datasources_missing[] | [.name]}'
83
+
84
+
85
+ Find dashboards and data sources:
60
86
61
87
# Search through all Grafana entities for string "ldi_readings".
62
88
grafana-wtf --grafana-url=https://daq.example.org/grafana/ --grafana-token=eyJrIjoiWHg...dGJpZCI6MX0= find ldi_readings
@@ -78,12 +104,12 @@ def run():
78
104
# Output search results in tabular format.
79
105
grafana-wtf find luftdaten --format=tabular:psql
80
106
81
- Replace examples :
107
+ Replace labels within dashboards :
82
108
83
109
# Replace string within specific dashboard.
84
110
grafana-wtf --select-dashboard=_JJ22OZZk replace grafana-worldmap-panel grafana-map-panel
85
111
86
- History examples :
112
+ Display edit history :
87
113
88
114
# Display 50 most recent changes across all dashboards.
89
115
grafana-wtf log --number=50
@@ -97,22 +123,6 @@ def run():
97
123
# Output full history table in Markdown format
98
124
grafana-wtf log --format=tabular:pipe
99
125
100
- Explore data sources:
101
-
102
- # Display all data sources and the dashboards using them, as well as unused data sources.
103
- grafana-wtf explore datasources --format=yaml
104
-
105
- # Display names of unused datasources as a flat list.
106
- grafana-wtf explore datasources --format=json | jq -r '.unused[].datasource.name'
107
-
108
- Explore dashboards:
109
-
110
- # Display some details of all dashboards, including names of missing data sources.
111
- grafana-wtf explore dashboards --format=yaml
112
-
113
- # Display only dashboards which have missing data sources, along with their names.
114
- grafana-wtf explore dashboards --format=json | jq '.[] | select( .datasources_missing ) | .dashboard + {ds_missing: .datasources_missing[] | [.name]}'
115
-
116
126
"""
117
127
118
128
# Parse command line arguments
0 commit comments