mirror of
https://github.com/jpec/fail2ban-report.git
synced 2024-12-22 13:32:14 +01:00
restrict to top 20 on pies to improve readability
This commit is contained in:
parent
6e1da37c28
commit
b4d73d4e1b
1 changed files with 4 additions and 4 deletions
|
@ -62,14 +62,14 @@ def generate_report(f_log, f_country, f_pdf):
|
|||
fig.savefig(pp, format='pdf')
|
||||
|
||||
nb_ban_by_country = get_nb_ban_by_country(data, f_country)
|
||||
df = pd.DataFrame.from_dict(nb_ban_by_country, orient='index').rename(columns={0:"Bans"}).sort_values(by='Bans', ascending=True) #.query('Bans > 1')
|
||||
plot = df.plot(title="Bans by country", kind='pie', subplots=True, legend=False, figsize=(10.0,10.0))
|
||||
df = pd.DataFrame.from_dict(nb_ban_by_country, orient='index').rename(columns={0:"Bans"}).sort_values(by='Bans', ascending=False).head(20)
|
||||
plot = df.plot(title="Bans by country (top 20)", kind='pie', subplots=True, legend=False, figsize=(10.0,10.0))
|
||||
fig = plot[0].get_figure()
|
||||
fig.savefig(pp, format='pdf')
|
||||
|
||||
nb_ban_by_ip = get_nb_ban_by_ip(data)
|
||||
df = pd.DataFrame.from_dict(nb_ban_by_ip, orient='index').rename(columns={0:"Bans"}).sort_values(by='Bans', ascending=True) #.query('Bans > 1')
|
||||
plot = df.plot(title="Bans by IP", kind='pie', legend=False, subplots=True, figsize=(10.0,10.0))
|
||||
df = pd.DataFrame.from_dict(nb_ban_by_ip, orient='index').rename(columns={0:"Bans"}).sort_values(by='Bans', ascending=False).head(20)
|
||||
plot = df.plot(title="Bans by IP (top 20)", kind='pie', legend=False, subplots=True, figsize=(10.0,10.0))
|
||||
fig = plot[0].get_figure()
|
||||
fig.savefig(pp, format='pdf')
|
||||
|
||||
|
|
Loading…
Reference in a new issue