Skip to content

Commit 94930a0

Browse files
committed
Update examples in README
1 parent 1826c6d commit 94930a0

File tree

1 file changed

+59
-9
lines changed

1 file changed

+59
-9
lines changed

README.md

Lines changed: 59 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,68 @@ Then, create a service account token for the newly created service account and s
3434

3535
## Usage
3636

37-
### Example
37+
### Readable output
3838

3939
```bash
4040
GRAFANA_TOKEN=glsa_aaaaaaaaaaa ./detect-angular-dashboards http://my-grafana.example.com/api
41-
2023/08/04 16:36:50 Detecting Angular dashboards for "http://my-grafana.example.com/api"
42-
2023/08/04 16:36:50 Found dashboard with Angular plugins "Angular" "http://my-grafana.example.com/api/d/daa8ddc2-1d1a-45c9-9691-6b87f8f35e5f/angular":
43-
2023/08/04 16:36:50 Found angular panel "satellogic-3d-globe-panel"
44-
2023/08/04 16:36:50 Found angular data source "akumuli-datasource"
45-
2023/08/04 16:36:50 Found angular data source "akumuli-datasource"
46-
2023/08/04 16:36:50 Found angular panel "pr0ps-trackmap-panel"
47-
2023/08/04 16:36:50 Found dashboard with Angular plugins "Angular 2" "http://my-grafana.example.com/api/d/fdca7a20-93bd-4e00-90b9-71543ceeaca2/angular-2":
48-
2023/08/04 16:36:50 Found angular data source "akumuli-datasource"
41+
2023/08/17 11:17:12 Detecting Angular dashboards for "http://my-grafana.example.com/api"
42+
2023/08/17 11:17:13 Found dashboard with Angular plugins "Angular" "http://my-grafana.example.com/d/ef5e2c21-88aa-4619-a5db-786cc1dd37a9/angular":
43+
2023/08/17 11:17:13 Found angular panel "Panel two" ("akumuli-datasource")
44+
2023/08/17 11:17:13 Found panel with angular data source "Angular" ("grafana-worldmap-panel")
45+
2023/08/17 11:17:13 Found dashboard with Angular plugins "Datasource tests - Elasticsearch v7" "http://my-grafana.example.com/d/Y-RvmuRWk/datasource-tests-elasticsearch-v7":
46+
2023/08/17 11:17:13 Found panel with angular data source "World map panel" ("grafana-worldmap-panel")
47+
2023/08/17 11:17:14 Found dashboard with Angular plugins "New dashboard" "http://my-grafana.example.com/d/e10a098c-ad80-4d3c-b979-c39a4ce41183/new-dashboard":
48+
2023/08/17 11:17:14 Found angular panel "My panel" ("akumuli-datasource")
49+
```
50+
51+
### JSON output
52+
53+
> Pass flag -j to the program to output in JSON format to stdout. All other messages will be sent to stderr.
54+
> The example below will produce a valid "output.json" file that can be used with other tools.
55+
56+
```bash
57+
GRAFANA_TOKEN=glsa_aaaaaaaaaaa ./detect-angular-dashboards http://my-grafana.example.com/api | tee output.json
58+
2023/08/17 11:25:54 Detecting Angular dashboards for "http://my-grafana.example.com/api"
59+
[
60+
{
61+
"Detections": [
62+
{
63+
"PluginID": "akumuli-datasource",
64+
"DetectionType": "datasource",
65+
"Title": "Panel two"
66+
},
67+
{
68+
"PluginID": "grafana-worldmap-panel",
69+
"DetectionType": "panel",
70+
"Title": "Angular"
71+
}
72+
],
73+
"URL": "http://my-grafana.example.com/d/ef5e2c21-88aa-4619-a5db-786cc1dd37a9/angular",
74+
"Title": "Angular"
75+
},
76+
{
77+
"Detections": [
78+
{
79+
"PluginID": "grafana-worldmap-panel",
80+
"DetectionType": "panel",
81+
"Title": "World map panel"
82+
}
83+
],
84+
"URL": "http://my-grafana.example.com/d/Y-RvmuRWk/datasource-tests-elasticsearch-v7",
85+
"Title": "Datasource tests - Elasticsearch v7"
86+
},
87+
{
88+
"Detections": [
89+
{
90+
"PluginID": "akumuli-datasource",
91+
"DetectionType": "datasource",
92+
"Title": "My panel"
93+
}
94+
],
95+
"URL": "http://my-grafana.example.com/d/e10a098c-ad80-4d3c-b979-c39a4ce41183/new-dashboard",
96+
"Title": "New dashboard"
97+
}
98+
]
4999
```
50100

51101
### Using pre-built binaries

0 commit comments

Comments
 (0)