|
68 | 68 | # ----------------------------- |
69 | 69 |
|
70 | 70 | query "activity_dashboard_total_logs" { |
71 | | - title = "Log Count" |
| 71 | + title = "Log Count" |
| 72 | + description = "Count the total log entries." |
72 | 73 |
|
73 | 74 | sql = <<-EOQ |
74 | 75 | select |
75 | 76 | count(*) as "Total Logs" |
76 | 77 | from |
77 | 78 | gcp_audit_log; |
78 | 79 | EOQ |
| 80 | + |
| 81 | + tags = { |
| 82 | + folder = "Project" |
| 83 | + } |
79 | 84 | } |
80 | 85 |
|
81 | 86 | query "activity_dashboard_logs_by_project" { |
82 | | - title = "Logs by Project" |
| 87 | + title = "Logs by Project" |
| 88 | + description = "Count the total log entries grouped by project." |
83 | 89 |
|
84 | 90 | sql = <<-EOQ |
85 | 91 | select |
|
95 | 101 | count(*) desc |
96 | 102 | limit 10; |
97 | 103 | EOQ |
| 104 | + |
| 105 | + tags = { |
| 106 | + folder = "Project" |
| 107 | + } |
98 | 108 | } |
99 | 109 |
|
100 | 110 | query "activity_dashboard_logs_by_type" { |
101 | | - title = "Logs by Type" |
| 111 | + title = "Logs by Type" |
| 112 | + description = "Count the total log entries grouped by type." |
102 | 113 |
|
103 | 114 | sql = <<-EOQ |
104 | 115 | select |
105 | | - split_part(log_name, '%2F', 2) as "Type", |
| 116 | + split_part(replace(log_name, '%2F', '/'),'/', 5) as "Type", |
106 | 117 | count(*) as "Logs" |
107 | 118 | from |
108 | 119 | gcp_audit_log |
109 | 120 | where |
110 | | - split_part(log_name, '%2F', 2) is not null |
| 121 | + split_part(replace(log_name, '%2F', '/'),'/', 5) is not null |
111 | 122 | group by |
112 | | - split_part(log_name, '%2F', 2) |
| 123 | + split_part(replace(log_name, '%2F', '/'),'/', 5) |
113 | 124 | order by |
114 | 125 | count(*) desc |
115 | 126 | limit 10; |
116 | 127 | EOQ |
| 128 | + |
| 129 | + tags = { |
| 130 | + folder = "Project" |
| 131 | + } |
117 | 132 | } |
118 | 133 |
|
119 | 134 | query "activity_dashboard_logs_by_service" { |
120 | | - title = "Logs by Service" |
| 135 | + title = "Top 10 Services" |
| 136 | + description = "List the top 10 services by frequency." |
121 | 137 |
|
122 | 138 | sql = <<-EOQ |
123 | 139 | select |
|
133 | 149 | count(*) desc |
134 | 150 | limit 10; |
135 | 151 | EOQ |
| 152 | + |
| 153 | + tags = { |
| 154 | + folder = "Project" |
| 155 | + } |
136 | 156 | } |
137 | 157 |
|
138 | 158 | query "activity_dashboard_logs_by_event" { |
139 | | - title = "Top 10 Events" |
| 159 | + title = "Top 10 Events" |
| 160 | + description = "List the 10 most frequently called events." |
140 | 161 |
|
141 | 162 | sql = <<-EOQ |
142 | 163 | select |
|
152 | 173 | count(*) desc |
153 | 174 | limit 10; |
154 | 175 | EOQ |
| 176 | + |
| 177 | + tags = { |
| 178 | + folder = "Project" |
| 179 | + } |
155 | 180 | } |
156 | 181 |
|
157 | 182 | query "activity_dashboard_logs_by_actor" { |
158 | | - title = "Top 10 Actors" |
| 183 | + title = "Top 10 Actors" |
| 184 | + description = "List the 10 most active actors." |
159 | 185 |
|
160 | 186 | sql = <<-EOQ |
161 | 187 | select |
|
171 | 197 | count(*) desc |
172 | 198 | limit 10; |
173 | 199 | EOQ |
| 200 | + |
| 201 | + tags = { |
| 202 | + folder = "Project" |
| 203 | + } |
174 | 204 | } |
175 | 205 |
|
176 | 206 | query "activity_dashboard_logs_by_source_ip" { |
177 | | - title = "Top 10 Source IPs" |
| 207 | + title = "Top 10 Source IPs (Excluding GCP Internal)" |
| 208 | + description = "List the 10 most active source IPs, excluding events from GCP internal." |
178 | 209 |
|
179 | 210 | sql = <<-EOQ |
180 | 211 | select |
|
191 | 222 | count(*) desc |
192 | 223 | limit 10; |
193 | 224 | EOQ |
| 225 | + |
| 226 | + tags = { |
| 227 | + folder = "Project" |
| 228 | + } |
194 | 229 | } |
0 commit comments