Commit graph

11634 commits

Author SHA1 Message Date
Robin Sommer
0006644e65 Merge branch 'master' of ssh://git.bro-ids.org/bro 2012-08-03 10:59:59 -07:00
Robin Sommer
9829cf9a29 Fixing little typo with big impact. 2012-08-03 10:45:45 -07:00
Jon Siwek
3bb6d4e54e Fix configure script to exit with non-zero status on error 2012-08-01 13:58:18 -05:00
Robin Sommer
01d91602ca Updating CHANGES and VERSION. 2012-08-01 09:57:19 -07:00
Robin Sommer
e3acf3af58 Updating submodule(s).
[nomail]
2012-07-30 11:59:53 -07:00
Robin Sommer
de3eba7062 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Improve log filter compatibility with remote logging.

Closes #842.
2012-07-30 11:49:08 -07:00
Jon Siwek
7b2c3db488 Improve log filter compatibility with remote logging.
If a log filter attempts to write to a path for which a writer is
already instantiated due to remote logging, it will re-use the writer
as long as the fields of the filter and writer are compatible, else
the filter path will be auto-adjusted to not conflict with existing
writer's.  Conflicts between two local filters are still always
auto-adjusted even if field types agree (since they could still
be semantically different).

Addresses #842.
2012-07-30 13:17:49 -05:00
Robin Sommer
38c2ee6894 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Add missing breaks to switch cases in ElasticSearch::HTTPReceive().
2012-07-30 09:13:49 -07:00
Jon Siwek
00d41bb549 Add missing breaks to switch cases in ElasticSearch::HTTPReceive().
Observed as reason for segfault in
testing/btest/scripts/check-test-all-policy.bro unit test when compiled
with optimizations.
2012-07-30 11:07:43 -05:00
Robin Sommer
4ba038070f Tweaking writer API for failed rotations.
There are now two FinishedRotation() methods, one that triggers
post-processing and one that doesn't. There's also insurance built in
against a writer not calling either (or both), in which case we abort
with an internal error.
2012-07-28 16:38:22 -07:00
Jon Siwek
4359bf6b42 Fix log manager hanging on waiting for pending file rotations.
This changes writer implementations to always respond to rotation
messages in their DoRotate() method, even for failure/no-op cases
with a new RotationFailedMessage.  This informs the manager to
decrement its count of pending rotations.

Addresses #860.
2012-07-28 16:23:59 -07:00
Robin Sommer
4bdac985cb Tweaking logs-to-elasticsearch.bro so that it doesn't do anything if
ES server is unset.
2012-07-28 11:21:20 -07:00
Robin Sommer
32590177a0 Merge remote-tracking branch 'origin/fastpath'
Also reenabling the logs-to-elasticsearch.bro script in
test-all-policy.bro, that seems to work now.

* origin/fastpath:
  Reworked how the logs-to-elasticsearch scripts works to stop abusing the logging framework.
2012-07-27 12:55:10 -07:00
Robin Sommer
9f2abd0697 Fix input test for recent default change on fastpath. 2012-07-27 12:39:20 -07:00
Robin Sommer
767a792148 Tests updates for recent open/close log change. 2012-07-27 12:39:11 -07:00
Seth Hall
596f07e505 Reworked how the logs-to-elasticsearch scripts works to stop abusing the logging framework.
- New variable in logging framework Log::active_streams to indicate
  Log:ID enums which are currently active.
2012-07-27 15:31:10 -04:00
Robin Sommer
c66c6d7c46 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Small (potential performance) improvement for logging framework.
  Script-level rotation postprocessor fix.
  update input framework documentation to reflect want_record change.
  Fix crash when encountering an InterpreterException in a predicate in logging or input Framework.
  make want_record=T the default for events
2012-07-27 12:26:18 -07:00
Robin Sommer
1fd0d7a607 Changing the start/end markers in logs to open/close now reflecting
wall clock.

Triggers lots of (simple) baseline updates.
2012-07-27 12:15:21 -07:00
Seth Hall
76520645bb Small (potential performance) improvement for logging framework. 2012-07-27 13:51:03 -04:00
Seth Hall
2a9993619f Script-level rotation postprocessor fix.
- This fixes a problem with writers that don't have a
  postprocessor.  Jon is still looking into the rotation
  problem in the core.
2012-07-27 13:49:49 -04:00
Bernhard Amann
a3798070da update input framework documentation to reflect want_record change. 2012-07-27 07:33:04 -07:00
Bernhard Amann
f02ed65878 Fix crash when encountering an InterpreterException in a predicate in logging or input Framework.
Inputframework: did not contain any error handling for this case.

Logging framework: tried to catch the interpreter-exception. However the exception already was caught
by the call-function and not propagated. Instead, call returns a 0-pointer in this case, which
lead to a segmentation fault.
2012-07-26 21:51:29 -07:00
Bernhard Amann
76ea182387 make want_record=T the default for events 2012-07-26 21:13:49 -07:00
Robin Sommer
f5862fb014 Preventing writers/readers from receiving further messages after a
failure.

Once a writer/reader Do* method has returned false, no further ones
will be executed anymore. This is primarily a safety mechanism to make
it easier for writer/reader authors as otherwise they would often need
to track the failure state themselves (because with the now delayed
termination from the earlier commit, furhter messages can now still
arrive for a little bit).
2012-07-26 17:27:56 -07:00
Robin Sommer
86ae7d8b7c Test for input framework failing to find a file.
The output isn't the nicest yet ...
2012-07-26 17:27:56 -07:00
Robin Sommer
743fc1680d Improving error handling for threads.
If a thread command fails (like the input framework not finding a
file), that now (1) no longer hangs Bro, and (2) even allows for
propagating error messages back before the thread is stops.

(Actually, the thread doesn't really "stop"; the thread manager keeps
threads around independent of their success; but it no longer polls
them for input.)

Closes #858.
2012-07-26 17:27:34 -07:00
Robin Sommer
ef3b75129f Updating baseline for custom-rotate test. 2012-07-26 15:38:12 -07:00
Robin Sommer
d262a70509 Merge remote-tracking branch 'origin/fastpath'
Small tweak: I added the "same writer" constraint to the loop
condition as well. Makes sense?

* origin/fastpath:
  Change path conflicts between log filters to be auto-corrected.
2012-07-26 15:30:35 -07:00
Robin Sommer
412bebb703 Tweaking the custom-rotate test to produce stable output.
There seems to be a race condition in capturing the external shell's
stdout output reliably. As far as I can tell, Bro's doing everything
correctly though, the log postprocessors gets executed as expected. So
I rewrote the test to capture the output in a separate file first, and
that seems to solve the test failures.
2012-07-26 15:25:48 -07:00
Jon Siwek
63e8bf72ed Change path conflicts between log filters to be auto-corrected.
This change makes it so when differing logging filters on the same
stream attempt to write to the same writer/path combination, the path
of the filter doing the later write will be automatically adjusted so
that it does not conflict with the other.  The path is adjusted by
appending "-N", where N is the smallest integer greater or equal to 2
required to resolve the path name conflict.

Addresses #842.
2012-07-26 16:55:49 -05:00
Robin Sommer
951444ee73 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  and remove superflous print.
  add testcase for subrecords and events add missing binary testcase (Baseline is in master, testcase is missing for some reason) make error output for nonmatching event types much more verbose
  Add more error handling for close() calls.
  add testcase for subrecords to input framework tests
2012-07-26 14:34:58 -07:00
Bernhard Amann
8633d91c40 and remove superflous print.
Yes, I know, look at the diff before committing...
2012-07-26 12:15:06 -07:00
Bernhard Amann
4a959c1a33 Merge remote-tracking branch 'origin/fastpath' into fastpath 2012-07-26 12:13:46 -07:00
Bernhard Amann
1a49363bbe add testcase for subrecords and events
add missing binary testcase (Baseline is in master, testcase is missing for some reason)
make error output for nonmatching event types much more verbose
2012-07-26 12:12:54 -07:00
Jon Siwek
a3ac3b8568 Merge branch 'fastpath' of git://git.bro-ids.org/bro into fastpath 2012-07-26 12:41:20 -05:00
Jon Siwek
734e5f68d3 Add more error handling for close() calls. 2012-07-26 12:40:12 -05:00
Bernhard Amann
84399c5d7d add testcase for subrecords to input framework tests 2012-07-26 08:58:12 -07:00
Robin Sommer
d872b1d9f6 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix double close() in FilerSerializer class.
  Fix build warnings
  Fixes to elasticsearch plugin to make libcurl handle http responses correctly.
2012-07-25 17:21:09 -07:00
Jon Siwek
c48a16664b Fix double close() in FilerSerializer class. 2012-07-25 18:05:42 -05:00
Daniel Thayer
c3aba199f6 Fix build warnings 2012-07-25 17:40:21 -05:00
Bernhard Amann
d29e691da9 ...adapt to new api... 2012-07-25 15:05:08 -07:00
Bernhard Amann
da157c8ded Merge remote-tracking branch 'origin/master' into topic/bernhard/sqlite
Conflicts:
	scripts/base/frameworks/logging/__load__.bro
	src/CMakeLists.txt
	src/logging.bif
	src/types.bif
2012-07-25 15:04:23 -07:00
Seth Hall
f2a0afad3c Fixes to elasticsearch plugin to make libcurl handle http responses correctly. 2012-07-25 17:01:47 -04:00
Robin Sommer
a33e9a6941 Fixing FreeBSD compiler error. 2012-07-25 13:58:23 -07:00
Robin Sommer
7e228f1d6b Silencing compiler warnings. 2012-07-25 13:58:08 -07:00
Robin Sommer
626c6d6d5b Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fix complaint from valgrind about uninitialized memory usage.
  Fix differing log filters of streams from writing to same writer/path.
  Fix tests and error message for to_double BIF
2012-07-25 13:10:14 -07:00
Jon Siwek
4abcfa1f66 Fix complaint from valgrind about uninitialized memory usage. 2012-07-25 12:42:46 -05:00
Jon Siwek
2fafadd930 Fix differing log filters of streams from writing to same writer/path.
Since WriterFrontend objects are looked up internally by writer type and
path, and they also expect to write consistent field arguments, it could
be the case that more than one filter of a given stream attempts to
write to the same path (derived either from $path or $path_func fields
of the filter) with the same writer type.  This won't work, so now
WriterFrontend objects are bound to the filter that instantiated them so
that we can warn about other filters attempting to write to the
conflicting writer/path and the write can be skipped.  Remote logs don't
appear to suffer the same issue due to pre-filtering.

Addresses #842.
2012-07-25 12:20:12 -05:00
Daniel Thayer
91522e7836 Fix tests and error message for to_double BIF 2012-07-25 12:10:47 -05:00
Robin Sommer
5af131e303 Compile fix. 2012-07-24 16:10:52 -07:00