This file contains 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/python | |
import re, sys, fileinput | |
class NginxLogParser: | |
""" | |
This class implements a nginx log parser. After feeding a nginx log format, it generates a regex for | |
that specify format. Then we use this regex to extract useful information from nginx log. | |
""" | |
format_directive = r'(\S)?\$([\w_]+)(\S)?' |
This file contains 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/python | |
import re, sys, fileinput | |
try: | |
search = sys.argv[1] | |
except: | |
search = '5' | |
class NginxLogParser: |
This file contains 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
package main | |
import ( | |
"errors" | |
"io" | |
"log" | |
"os" | |
"time" | |
"github.com/goftp/server" |