summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/daq/accesslog/sfive-accesslog.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/daq/accesslog/sfive-accesslog.py b/src/daq/accesslog/sfive-accesslog.py
index 94a0309..e88d7e4 100755
--- a/src/daq/accesslog/sfive-accesslog.py
+++ b/src/daq/accesslog/sfive-accesslog.py
@@ -36,6 +36,7 @@ from twisted.internet import protocol, reactor, unix
import socket
from time import sleep
+import sys
import re
import simplejson as json
import datetime
@@ -118,7 +119,7 @@ class AccessLog():
def _initLog(self):
try:
- self._fd = open(self._logfile, 'r')
+ self._fd = open(self._logfile, 'r') if self._logfile != '-' else sys.stdin
regex = self._nameformat % { 'hostname': self._hostname,
'content-id': self._content_id,
'format': self._format,
@@ -248,7 +249,7 @@ if __name__ == '__main__':
parser.add_argument('--tag', '-t', dest='tags', action='append',
help='tag to be added to the statistic data, can be invoked several times')
parser.add_argument('--logfile', '-l', dest='logfile', required=True,
- help='path to the logfile')
+ help='path to the logfile or \'-\' for standard input')
parser.add_argument('--nameformat', '-F', dest='nameformat', required=True,
help='the format for filenames which are part of this stream, this may include python string expressions')
args = vars(parser.parse_args())