Commit 8dbdacad authored by Thorsten Simons's avatar Thorsten Simons

1.4.0 - compatibility changes for HCP 8.x

parent 8e427040
Release History
===============
**1.4.0 2018-12-27**
* made compatibility changes for log packages created by HCP 8.x
**1.3.8 2017-12-07**
* fixed a bug that caused log packages to fail if they contained HCP-S logs
......
......@@ -65,14 +65,14 @@ Support
-------
If you've found any bugs, please let me know via the Issue Tracker;
if you have comments or suggestions, send an email to `<sw@snomis.de>`_
if you have comments or suggestions, send an email to `<sw@snomis.eu>`_
License
-------
The MIT License (MIT)
Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
......
......@@ -65,14 +65,14 @@ Support
-------
If you've found any bugs, please let me know via the Issue Tracker;
if you have comments or suggestions, send an email to `<sw@snomis.de>`_
if you have comments or suggestions, send an email to `<sw@snomis.eu>`_
License
-------
The MIT License (MIT)
Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
......
......@@ -4,7 +4,7 @@ License / Trademarks
The MIT License (MIT)
---------------------
Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
......
# The MIT License (MIT)
#
# Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
# The MIT License (MIT)
#
# Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
# The MIT License (MIT)
#
# Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -136,6 +136,11 @@ class DB():
# 10.46.165.130 - webfarm_PROD [16/Aug/2017:23:03:09 +0200] "PUT /rest/7/5/file HTTP/1.1" 201 0 GEDP.saez 113
# 10.49.253.207 - - [12/Sep/2017:08:03:39 +0200] "OPTIONS /fcfs_data/Symantec_EV/ HTTP/1.1" 403 0 0
# but since v8.x:
# 84.208.27.142 - nap_admin [18/Dec/2018:00:16:44 +0100] "PUT /xyzbucket/path/data.patch?uploadId=98885669940161&partNumber=13 HTTP/1.1" 200 0 nlogic@hs3 6181 011 16777216
# 84.208.27.142 - nap_admin [18/Dec/2018:00:16:53 +0100] "POST /xyzbucket/path/data.patch?uploadId=98885669940161 HTTP/1.1" 200 905 nlogic@hs3 145 011 1232
# where the last 2 entries are the node-id and the no. of bytes uploaded
cur = self.con.cursor()
cur.execute("SELECT * from admin")
_admin = row2dict(cur.fetchone())
......@@ -164,6 +169,14 @@ class DB():
}
_admin['start'] = _tsnum if _tsnum < _admin['start'] else _admin['start']
_admin['end'] = _tsnum if _tsnum > _admin['end'] else _admin['end']
# mix in size for PUT/POST if available (v8)
if _r['request'] in ['PUT', 'POST']:
try:
_r['size'] = rec[13]
except IndexError:
pass
except IndexError as e:
print('IndexError on {} \n\t- {}'.format(rec, e))
continue
......
# Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -65,6 +65,7 @@ class Handler(object):
# logs
nodes = self.parsemanifest(join(self.tmpdir.name, archdir,
'manifest.csv'))
# nodes =
# [('192.168.0.176',
# 'HCPLogs-hcp72.archivas.com-acc-20170911-1603/176.tar.bz2',
......@@ -75,7 +76,8 @@ class Handler(object):
print('\tun-packing access logs for node {}'.format(i[0]))
unpack_archive(join(self.tmpdir.name, i[1]),
join(self.tmpdir.name, archdir),
format='bztar')
)
# format='bztar') # doesn't work with v8
# now, we have a structure like this:
# HCPLogs-hcp-domain.com-YYYMMDD-HHMM
# 176 (where 176 is the node id)
......@@ -134,8 +136,11 @@ class Handler(object):
# octet being 1- or 2-digit, only, we need to fix that
# and make it 3-digit, as the de-compressed folder will
# have a 3-digit anyway
tdir = cols[1][:-8].split('/')
tdir = '{}/{:03}'.format(tdir[0], int(tdir[1]))
# tdir = cols[1][:-8].split('/') - doesn'T work with 8.x
tdir = cols[1].split('/')[1].split('.')[0]
tdir = '{}/{:03}'.format(cols[1].split('/')[0], int(tdir))
# tdir = '{}/{:03}'.format(tdir[0], int(tdir[1]))
result.append((cols[0], cols[1], tdir))
return result
......
# The MIT License (MIT)
#
# Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
# The MIT License (MIT)
#
# Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
# The MIT License (MIT)
#
# Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
# The MIT License (MIT)
#
# Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -89,7 +89,7 @@ class Xlsx(Csv):
self.wb = xlsxwriter.Workbook('{}-analyzed.xlsx'.format(prefix))
self.wb.set_properties({'title': 'HCP Request Analytics',
'author': 'hcprequestanalytics by Thorsten '
'Simons (sw@snomis.de)',
'Simons (sw@snomis.eu)',
'category': 'analytics',
'comments': 'Documentation at '
'https://hcprequestanalytics.'
......
# The MIT License (MIT)
#
# Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......
# -*- coding: utf-8 -*-
# The MIT License (MIT)
#
# Copyright (c) 2015 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2015 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
......
# The MIT License (MIT)
#
# Copyright (c) 2017 Thorsten Simons (sw@snomis.de)
# Copyright (c) 2017-2018 Thorsten Simons (sw@snomis.eu)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
......@@ -27,8 +27,8 @@ class Gvars:
"""
# version control
s_version = "1.3.8"
s_builddate = '2017-12-07'
s_version = "1.4.0"
s_builddate = '2018-12-27'
s_build = "{}/Sm".format(s_builddate)
s_minPython = "3.4.3"
s_description = "hcprequestanalytics"
......@@ -38,7 +38,7 @@ class Gvars:
Version = "v.{} ({})".format(s_version, s_build)
Description = 'hcprequestanalytics - analyze HCP HTTP request logs'
Author = "Thorsten Simons"
AuthorMail = "sw@snomis.de"
AuthorMail = "sw@snomis.eu"
AuthorCorp = ""
AppURL = ""
License = ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment