This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Normal person mode | |
def next_server_number(l): | |
if len(l) < 1: | |
return 1 | |
for i in xrange(1, max(l)): | |
if i not in l: | |
return i | |
return max(l) + 1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# usage ./verify_splunk_coverage.py <log_file> | |
# set these from splunk-apps/apps/<service-name>/default/props.conf | |
BREAK_ONLY_BEFORE_REGEX=r'^\d\d:\d\d:\d\d\s\[[^\]]+\]' | |
EXTRACT_REGEX=r'^\d?\d:\d\d:\d\d\s\[(?P<thread>[^\]]+)\]\s\[(?P<loglevel>\w+)\]\s\[(?P<class>[^\]]+)\]\s\[(?P<username>[^\]]*)\](?P<message>.*)$' | |
import re,sys | |
f = open(sys.argv[1]) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fileinput | |
x = "" | |
for line in fileinput.input(): | |
x += line | |
s = "" | |
i = 1 | |
while i < len(x): | |
if x[i] == '"': | |
i += 1 |
NewerOlder