Skip to content

Commit

Permalink
Merge pull request amitzilblog#2 from landstander668/missing_program_…
Browse files Browse the repository at this point in the history
…name

Handle case where PROGRAM entry is unspecified
  • Loading branch information
amitzilblog authored May 11, 2018
2 parents 19a7cd5 + 8f5d4ed commit c05abcc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion analyze_lsnr_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@
line_datef = datetime.strptime(line_date,"%d-%b-%Y")
line_connectdata = line.split("*")[1]
line_address = line.split("*")[1]
data_search = re.search(r'PROGRAM=.[^\)]*', line_connectdata, re.M|re.I)
data_search = re.search(r'PROGRAM=[^\)]*', line_connectdata, re.M|re.I)
if data_search is not None:
line_prog = data_search.group().split("=")[1].split("\\")[-1]
if line_prog == "" : line_prog = "*UNSPECIFIED*"
if line_prog != "null":
try:
dict_program[line_datef,line_prog] += 1
Expand Down

0 comments on commit c05abcc

Please sign in to comment.