jsonout
index
/usr/local/lib/python2.7/site-packages/dshell/lib/output/jsonout.py

@author: amm

 
Modules
       
datetime
json
output

 
Classes
       
output.TextOutput(output.FileOutput)
JSONOutput

 
class JSONOutput(output.TextOutput)
    JSON Output module
use with --output=jsonout
 
        usage: as with csvout, you can pass a list of field names that will be included in the JSON output
 
        options
        -------
        geoip:        If set to Y, output module won't discard geoip tags
        notrim:       If set to Y, do not trim any fields from the output
        ensure_ascii: Enable this option in json library
 
 
Method resolution order:
JSONOutput
output.TextOutput
output.FileOutput
output.Output
__builtin__.object

Methods defined here:
__init__(self, *args, **kwargs)
alert(self, *args, **kw)

Methods inherited from output.FileOutput:
close(self)
close output if not stdout
write(self, obj, **kw)
write session data to the session output or stdout

Methods inherited from output.Output:
dispatch(self, m, *args, **kwargs)
dispatch from Q pop
dump(self, pkt=None, **kw)
dump raw packet data to an output
override this if you want a format other than pcap
log(self, msg, level=20, *args, **kw)
write a message to the log
passes all args and kwargs thru to logging
except for level= is used to set logging level
parse(self, *args, **kw)
parse the input args/kwargs into a record dict according to format string
- timestamps are formatted to date/time strings
        - fields not in the input will be defined but blank
        - extra fields in the record will be formatted into a
               "name=value name2=value2..." string and put in 'extra'
        - args will go into 'data'
        - format keyword can contain a new format string to use (this also sets format for future output)
setformat(self, formatstr=None, typemap=None)
parse a format string and extract the field info
        if no string given, reverts to default for class
   will set self.fields to be a list of (name,type,spec) tuples
   self.fieldnames to a list of fieldnames
        and self.fieldmap to a list of key=in value=out mappings
format string can also map in field to out field with %(in:out)spectype
 or specify an explicit out type with %(in:out)specintype:outtype
(note this breaks compatibility with text formatting,
  but useful for db or other output modules)
  a typemap of [intype]=outtype (or [in]=(newintype,outtype)
                  can be used to map and replace types

Data descriptors inherited from output.Output:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
obj = class JSONOutput(output.TextOutput)
    JSON Output module
use with --output=jsonout
 
        usage: as with csvout, you can pass a list of field names that will be included in the JSON output
 
        options
        -------
        geoip:        If set to Y, output module won't discard geoip tags
        notrim:       If set to Y, do not trim any fields from the output
        ensure_ascii: Enable this option in json library
 
 
Method resolution order:
JSONOutput
output.TextOutput
output.FileOutput
output.Output
__builtin__.object

Methods defined here:
__init__(self, *args, **kwargs)
alert(self, *args, **kw)

Methods inherited from output.FileOutput:
close(self)
close output if not stdout
write(self, obj, **kw)
write session data to the session output or stdout

Methods inherited from output.Output:
dispatch(self, m, *args, **kwargs)
dispatch from Q pop
dump(self, pkt=None, **kw)
dump raw packet data to an output
override this if you want a format other than pcap
log(self, msg, level=20, *args, **kw)
write a message to the log
passes all args and kwargs thru to logging
except for level= is used to set logging level
parse(self, *args, **kw)
parse the input args/kwargs into a record dict according to format string
- timestamps are formatted to date/time strings
        - fields not in the input will be defined but blank
        - extra fields in the record will be formatted into a
               "name=value name2=value2..." string and put in 'extra'
        - args will go into 'data'
        - format keyword can contain a new format string to use (this also sets format for future output)
setformat(self, formatstr=None, typemap=None)
parse a format string and extract the field info
        if no string given, reverts to default for class
   will set self.fields to be a list of (name,type,spec) tuples
   self.fieldnames to a list of fieldnames
        and self.fieldmap to a list of key=in value=out mappings
format string can also map in field to out field with %(in:out)spectype
 or specify an explicit out type with %(in:out)specintype:outtype
(note this breaks compatibility with text formatting,
  but useful for db or other output modules)
  a typemap of [intype]=outtype (or [in]=(newintype,outtype)
                  can be used to map and replace types

Data descriptors inherited from output.Output:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Data
        __warningregistry__ = {("Not importing directory '/wrkdirs/usr/ports/net/...k/Dshell-46e691c/lib/output': missing __init__.py", <type 'exceptions.ImportWarning'>, 5): True}