зеркало из https://github.com/mozilla/MozDef.git
Merge pull request #101 from netantho/averez-esworker-fix
esworker: cast to int/float values for fields ending with _int/_float
This commit is contained in:
Коммит
bc3a28594f
|
@ -48,10 +48,10 @@ ADD conf/nginx.conf /etc/nginx/
|
|||
|
||||
#Mozdef
|
||||
RUN (apt-get install -q -y python2.7-dev python-pip curl supervisor wget\
|
||||
# && curl -L https://github.com/jeffbryner/MozDef/archive/master.tar.gz |tar -C /opt -xz \
|
||||
# && /bin/ln -s /opt/MozDef-master /opt/MozDef \
|
||||
&& curl -L https://github.com/netantho/MozDef/archive/averez-docker.tar.gz |tar -C /opt -xz \
|
||||
&& /bin/ln -s /opt/MozDef-averez-docker /opt/MozDef \
|
||||
&& curl -L https://github.com/jeffbryner/MozDef/archive/master.tar.gz |tar -C /opt -xz \
|
||||
&& /bin/ln -s /opt/MozDef-master /opt/MozDef \
|
||||
# && curl -L https://github.com/netantho/MozDef/archive/averez-esworker-fix.tar.gz |tar -C /opt -xz \
|
||||
# && /bin/ln -s /opt/MozDef-averez-esworker-fix /opt/MozDef \
|
||||
&& cd /opt/MozDef && /usr/bin/pip install --verbose --use-mirrors --timeout 30 -r requirements.txt \
|
||||
&& /usr/bin/pip install --verbose --use-mirrors --timeout 30 uwsgi gevent \
|
||||
&& mkdir /var/log/mozdef \
|
||||
|
|
|
@ -219,7 +219,13 @@ def keyMapping(aDict):
|
|||
if 'details' not in returndict.keys():
|
||||
returndict[u'details'] = dict()
|
||||
# add field
|
||||
returndict[u'details'][unicode(newName)] = toUnicode(v)
|
||||
if newName.endswith('_int'):
|
||||
returndict[u'details'][unicode(newName)] = int(v)
|
||||
elif newName.endswith('_float'):
|
||||
returndict[u'details'][unicode(newName)] = float(v)
|
||||
else:
|
||||
returndict[u'details'][unicode(newName)] = toUnicode(v)
|
||||
|
||||
except Exception as e:
|
||||
sys.stderr.write('esworker exception normalizing the message %r\n' % e)
|
||||
return None
|
||||
|
|
Загрузка…
Ссылка в новой задаче