Commit 5f6f33c7 authored by Doak, Peter W's avatar Doak, Peter W
Browse files

list of lists for parsing headers now supported

parent daaa4e41
......@@ -87,15 +87,16 @@ def read_output_influx(log):
int(time.time())))
influx_lines.append(influx_point)
if 'header' in config:
for find_this, then_do in config['header'].iteritems():
for find_this, then_dos in config['header'].iteritems():
match = re.search(find_this, line)
if match:
try:
the_value = (line.split())[then_do[0]-1]
print line.split()
the_value = re.sub(r':',r'',the_value)
print "Header -- {}: {}".format(then_do[1], the_value)
influx_point = ("header,user_name={},code={},"
for then_do in then_dos:
the_value = (line.split())[then_do[0]-1]
print line.split()
the_value = re.sub(r':',r'',the_value)
print "Header -- {}: {}".format(then_do[1], the_value)
influx_point = ("header,user_name={},code={},"
"host={} {}={} {}\n"
.format(config['user_name'],
config['job_prefix'],
......@@ -103,8 +104,8 @@ def read_output_influx(log):
then_do[1],
the_value,
int(time.time())))
influx_lines.append(influx_point)
watch_log.write("Header -- {}: {}\n".format(then_do[1], the_value))
influx_lines.append(influx_point)
watch_log.write("Header -- {}: {}\n".format(then_do[1], the_value))
except IndexError as ie:
print "found", find_this, "index error, no column ", ie, " in: "
print line
......
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