mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-08-19 21:03:21 -07:00
PHT sometimes not logging IP. This fix may help.
This commit is contained in:
parent
5b2d03f496
commit
cf55f239fb
1 changed files with 4 additions and 3 deletions
|
@ -317,13 +317,14 @@ class MonitorProcessing(object):
|
||||||
logger.debug(u"PlexPy Monitor :: Requesting log lines...")
|
logger.debug(u"PlexPy Monitor :: Requesting log lines...")
|
||||||
log_lines = log_reader.get_log_tail(window=5000, parsed=False)
|
log_lines = log_reader.get_log_tail(window=5000, parsed=False)
|
||||||
|
|
||||||
rating_key_line = 'metadata%2F' + rating_key
|
rating_key_line = 'ratingKey=' + rating_key
|
||||||
|
rating_key_line_2 = 'metadata%2F' + rating_key
|
||||||
machine_id_line = 'session=' + machine_id
|
machine_id_line = 'session=' + machine_id
|
||||||
|
|
||||||
for line in reversed(log_lines):
|
for line in reversed(log_lines):
|
||||||
# We're good if we find a line with both machine id and rating key
|
# We're good if we find a line with both machine id and rating key
|
||||||
# This is usually when there is a transcode session
|
# This is usually when there is a transcode session
|
||||||
if machine_id_line in line and rating_key_line in line:
|
if machine_id_line in line and (rating_key_line in line or rating_key_line_2 in line):
|
||||||
# Currently only checking for ipv4 addresses
|
# Currently only checking for ipv4 addresses
|
||||||
ipv4 = re.findall(r'[0-9]+(?:\.[0-9]+){3}', line)
|
ipv4 = re.findall(r'[0-9]+(?:\.[0-9]+){3}', line)
|
||||||
if ipv4:
|
if ipv4:
|
||||||
|
@ -344,7 +345,7 @@ class MonitorProcessing(object):
|
||||||
log_lines = log_reader.get_log_tail(window=5000, parsed=False)
|
log_lines = log_reader.get_log_tail(window=5000, parsed=False)
|
||||||
|
|
||||||
for line in reversed(log_lines):
|
for line in reversed(log_lines):
|
||||||
if 'GET /:/timeline' in line and rating_key_line in line:
|
if 'GET /:/timeline' in line and (rating_key_line in line or rating_key_line_2 in line):
|
||||||
# Currently only checking for ipv4 addresses
|
# Currently only checking for ipv4 addresses
|
||||||
# This method can return the wrong IP address if more than one user
|
# This method can return the wrong IP address if more than one user
|
||||||
# starts watching the same media item around the same time.
|
# starts watching the same media item around the same time.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue