Commit Graph

36 Commits (61b72c6981fd578a00b2bf9e1c8a10f2b741e4b5)

Author SHA1 Message Date
Victor Julien 586774203f redis: support for all output types 10 years ago
Victor Julien 2820ed332e redis: use 'binary' notation for output 10 years ago
fooinha f6c0abaae7 eve: check redis reply in non pipeline mode
We may lose the reply if disconnection happens.
Reconnection is needed.
10 years ago
Victor Julien 8600872e02 logfile: resolve name clash on SunOS 10 years ago
maxtors bf551ace4e Use ConfValIsTrue for parseing util-logfile append value. 10 years ago
Victor Julien 37a64bdd45 redis: fix compiler warning 11 years ago
Eric Leblond 9930f447d2 output-json: fix regression on log prefix handling
The log prefix option was not anymore honored due to a regression
caused by some recent code.
11 years ago
Victor Julien c80990fe10 output: cleanup JSON logging 11 years ago
Victor Julien ad5a753dde output-json: don't alloc for JSON to string 11 years ago
Eric Leblond d88e133428 util-logopenfile: don't allocate redis command
As we only have two different commands we don't need to allocate
it and can use pointer to global variables.
11 years ago
Eric Leblond 2ea4bbc492 util-logopenfile: move sensor_name to filectx
We will now output the sensor name independantly of the output
method if it is set in the YAML file. In the case of redis we are
using the hostname value if unset.
11 years ago
Eric Leblond 7e3a5a0db2 util-logopenfile: log queued events at exit
Do a redis query at exit to log possibly existing events.
11 years ago
Eric Leblond 404e660410 util-logopenfile: don't lock syslog write 11 years ago
Eric Leblond c5d939834f util-logopenfile: cleaner free function 11 years ago
Eric Leblond 1b0f2774f2 util-logopenfile: don't use atomic for batch_count 11 years ago
Eric Leblond e9d26dd510 util-logopenfile: use a function for redis write 11 years ago
Eric Leblond f11b269ef1 redis-output: fix sensor-name code
The sensor-name was not freed at exist and the result of SCStrdup
was not checked.
11 years ago
Eric Leblond 594f62b523 util-logopenfile: reconnect handling
This patch implements reconnection handling for the redis output.
A reconnect limitation has been implemented with a limitation of
one connection per second.
11 years ago
Eric Leblond b834e2d19a util-logopenfile: implement redis pipelining
This patch implements redis pipelining. This consist in contacting
the redis server every N events to minimize the number of TCP
exchange. This is optional and setup via the configuration file.
11 years ago
Eric Leblond f953fdfbac util-logopenfile: introduce SCConfLogOpenRedis
Introduce a function to realize the parsing and config file and
opening of connection to the database. Only used by output-json
for now it will be usable by other logging modules.
11 years ago
Eric Leblond a13be67b5e util-logopenfile: add write function
Introduce a function LogFileWrite that will handle the writing with
respect of the type defined in the configuration. This is used in
this patch to remove the write complexity from output-json.
11 years ago
Eric Leblond eef5678e5e output-json: add redis support
This patch adds redis support to JSON output.
11 years ago
Jeff Barber 893fc9660d Support for reconnecting unix domain socket log files
Issue #1423
11 years ago
Jason Ish b512580bbe logging: integrate rotation into SCConfLogOpenGeneric.
Addresses issue 1492, and will make it harder to omit
rotation on new outputs.
11 years ago
Jason Ish ab1d69fc4e When re-opening a log file on HUP, always append.
This will prevent log files that have not been rotated by some
external tool from being deleted, but log files that were
rotated (moved out of the way) will be re-opened.

This is a better default behaviour, especially when not all
log files are rotated at the same time.

Thanks to iro on IRC.
12 years ago
Victor Julien fdd407751e Fix eve 'filetype' parsing
Now that we use 'filetype' instead of 'type', we should also
use 'regular' instead of 'file'.

Added fallback to make sure we stay compatible to old configs.
12 years ago
Alexander Gozman a0bb4477db Fix possible crash when logfile descriptor is invalid 12 years ago
Jason Ish c1b6894ce3 Add a rotation flag to LogFileCtx which loggers can use to register
for log rotation.  Have the LogFileCtx handle the log rotation.
12 years ago
Ken Steele 497575d38e Add option on Tile-Gx for logging for fast.log alerts over PCIe
When running on a TILEncore-Gx PCIe card, setting the filetype of fast.log
to pcie, will open a connection over PCIe to a host application caleld
tile-pcie-logd, that receives the alert strings and writes them to a file
on the host. The file name to open is also passed over the PCIe link.

This allows running Suricata on the TILEncore-Gx PCIe card, but have the
alerts logged to the host system's file system efficiently. The PCIe API that
is used is the Tilera Packet Queue (PQ) API which can access PCIe from User
Space, thus avoiding system calls.

Created util-logopenfile-tile.c and util-logopen-tile.h for the TILE
specific PCIe logging functionality.

Using Write() and Close() function pointers in LogFileCtx, which
default to standard write and close for files and sockets, but are
changed to PCIe write and close functions when a PCIe channel is
openned for logging.

Moved Logging contex out of tm-modules.h into util-logopenfile.h,
where it makes more sense. This required including util-logopenfile.h
into a couple of alert-*.c files, which previously were getting the
definitions from tm-modules.h.

The source and Makefile for tile-pcie-logd are added in contrib/tile-pcie-logd.

By default, the file name for fast.log specified in suricata.yaml is used as
the filename on the host. An optional argument to tile-pcie-logd, --prefix=,
can be added to prepend the supplied file path. For example, is the file
in suricata.yaml is specified as "/var/log/fast.log" and --prefix="/tmp",
then the file will be written to "/tmp/var/log/fast.log".

Check for TILERA_ROOT environment variable before building tile_pcie_logd

Building tile_pcie_logd on x86 requires the Tilera MDE for its PCIe libraries
and API header files. Configure now checs for TILERA_ROOT before enabling
builing tile_pcie_logd in contrib/tile_pcie_logd
13 years ago
Eric Leblond 34abd818dd Prefix util-conf function with Config 13 years ago
Eric Leblond 54006de40c Use new function GetLogDirectory() 13 years ago
Eric Leblond 6784ec536d Fix OpenBSD compilation. 14 years ago
Victor Julien 4cd2938c68 Fix PathIsAbsolute function not dealing with CYGWIN. Handle absolute paths in logfile api. 15 years ago
Victor Julien 2c62b50ed5 Fix 2 compiler warnings. 15 years ago
Mike Pomraning cfced01641 Use strlcpy 15 years ago
Mike Pomraning dec34afa40 SCConfLogOpenGeneric() abstraction for regular and AF_UNIX logs.
util-logopenfile.[ch] implements the abstraction; util-error.[ch]
modified to include a socket-specific error code; output.h adds a
default filetype for logs ("regular").
15 years ago