@@ -189,11 +189,11 @@ def gen_top_fps_file():
189
189
print ('---' , file = f )
190
190
191
191
aws_athena_query_to_file (
192
- 'SELECT stat, "substr"(stat, 19, ("length"(stat) - 26)) pluginId, alerts.name, alerts.status, alerts.type, "sum"(value) count ' +
192
+ 'SELECT alerts. pluginId, alerts.name, alerts.status, alerts.type, "sum"(value) count ' +
193
193
'FROM ("project_zap_stats"."tel_therest" ' +
194
- 'INNER JOIN "project_zap_stats"."alerts" ON (alerts.pluginId = CAST("substr"(tel_therest.stat, 19, ("length"(stat) - 26)) AS integer))) ' +
194
+ 'INNER JOIN "project_zap_stats"."alerts" ON (alerts.pluginId = CAST("split_part"(" substr"(tel_therest.stat, 19, ("length"(stat) - 26)), \' - \' , 1 ) AS integer))) ' +
195
195
'WHERE (' + last_mon_sql + ' AND (stat LIKE \' stats.alertFilter%-1\' )) ' +
196
- 'GROUP BY stat , alerts.name, alerts.status, alerts.type ' +
196
+ 'GROUP BY alerts.pluginId , alerts.name, alerts.status, alerts.type ' +
197
197
'ORDER BY count DESC LIMIT 20' , tempfile )
198
198
if os .path .isfile (tempfile ):
199
199
first = True
@@ -204,10 +204,10 @@ def gen_top_fps_file():
204
204
first = False
205
205
else :
206
206
vals = line .split (',' )
207
- print ('- id: ' + vals [1 ].replace ('"' , '' ), file = f )
208
- print (' name: ' + vals [2 ], file = f )
209
- print (' status: ' + vals [3 ], file = f )
210
- print (' type: ' + vals [4 ], file = f )
207
+ print ('- id: ' + vals [0 ].replace ('"' , '' ), file = f )
208
+ print (' name: ' + vals [1 ], file = f )
209
+ print (' status: ' + vals [2 ], file = f )
210
+ print (' type: ' + vals [3 ], file = f )
211
211
212
212
def gen_top_ascan_rules_file ():
213
213
outfile = utils .websitedir () + 'site/data/charts/top_ascan_rules_last_month.yaml'
0 commit comments