diff options
| author | Ralph Bean <rbean@redhat.com> | 2015-02-02 15:34:29 +0000 |
|---|---|---|
| committer | Ralph Bean <rbean@redhat.com> | 2015-02-02 15:34:47 +0000 |
| commit | 31c2f114115b8f6177a8d59c333620fd7e872f3d (patch) | |
| tree | ff8e9fc42be5bf1ee1f3463c5501000bf4471898 /scripts | |
| parent | 23a095336e014096a410fad0323ac7939c9f69a3 (diff) | |
| download | ansible-31c2f114115b8f6177a8d59c333620fd7e872f3d.tar.gz ansible-31c2f114115b8f6177a8d59c333620fd7e872f3d.tar.xz ansible-31c2f114115b8f6177a8d59c333620fd7e872f3d.zip | |
Cosmetic - Try to make scripts/logview more readable.
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/logview | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scripts/logview b/scripts/logview index 334f07496..e912475ac 100755 --- a/scripts/logview +++ b/scripts/logview @@ -55,8 +55,13 @@ def search_logs(opts, logfiles): if len(things) < 5: msg += "(logview error - unhandled line): %r\n" % line continue - if things[2] in opts.search_terms or 'ANY' in opts.search_terms: - slurp = json.loads(things[4]) + + # See callback_plugins/logdetail.py for how these lines get created. + #MSG_FORMAT="%(now)s\t%(count)s\t%(category)s\t%(name)s\t%(data)s\n" + task_ts, count, category, name, data = things + + if category in opts.search_terms or 'ANY' in opts.search_terms: + slurp = json.loads(data) if opts.profile: st = slurp.get('task_start', 0) end = slurp.get('task_end', 0) @@ -65,7 +70,9 @@ def search_logs(opts, logfiles): else: dur = None - msg += '%s\t%s\t%s\t%s\t%s\t%s' % (timestamp, hostname, things[0], things[1], things[2], things[3]) + msg += '%s\t%s\t%s\t%s\t%s\t%s' % ( + timestamp, hostname, task_ts, count, category, name) + if not opts.verbose: if type(slurp) == dict: for term in ['task_userid', 'cmd']: |
