This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Input string: | |
2015-12-15T07:36:25+00:00 sundaysister kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ClearFeatureInterruptEndpointHalt] -- successfully posting another read for the mInt0InterruptPipe -- mInterruptPipeInOutstandingIOCount = 1 -- this = 0xb800"; | |
veryDescriptiveMatch: ^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\+\d{2}:\d{2} | |
descriptiveMatch: .{4}-.{2}-.{2}T.{2}:.{2}:.{2}\+.{2}:.{2} | |
openMatch: .*-.*-.*T.*:.*:.*\+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@State(Scope.Benchmark) | |
@BenchmarkMode(Mode.AverageTime) | |
@OutputTimeUnit(TimeUnit.MICROSECONDS) | |
public class DateRegexBenchmark { | |
private static final String MESSAGE = "2015-12-15T07:36:25+00:00 sundaysister kernel[0]: **** [IOBluetoothHostControllerUSBTransport][ClearFeatureInterruptEndpointHalt] -- successfully posting another read for the mInt0InterruptPipe -- mInterruptPipeInOutstandingIOCount = 1 -- this = 0xb800"; | |
private static Pattern VERY_DESCRIPTIVE; | |
private static Pattern DESCRIPTIVE; | |
private static Pattern OPEN; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run complete. Total time: 00:03:53 | |
Benchmark Mode Cnt Score Error Units | |
DateRegexBenchmark.descriptiveMatch avgt 50 0.237 ± 0.003 us/op | |
DateRegexBenchmark.openMatch avgt 50 32.325 ± 0.361 us/op | |
DateRegexBenchmark.veryDescriptiveMatch avgt 50 0.190 ± 0.002 us/op |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.graylog2.plugin.Message | |
import java.util.regex.Matcher | |
import java.util.regex.Pattern | |
rule "Rename level field to avoid ES type collision" | |
when | |
m : Message( message matches ".*level=.*" ); | |
then | |
Matcher matcher = Pattern.compile("level=(.+?)(\\s|$)").matcher(m.getMessage()); | |
if (matcher.find()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lennart ~/workspace/graylog2/graylog2-server(0.20)$ mongo | |
MongoDB shell version: 2.4.1 | |
connecting to: test | |
> use graylog2 | |
switched to db graylog2 | |
> db.system_messages.remove() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-03-13 12:05:13,673 INFO : org.graylog2.Core - SIGNAL received. Shutting down. | |
2014-03-13 12:05:13,676 INFO : org.graylog2.system.shutdown.GracefulShutdown - Graceful shutdown initiated. | |
2014-03-13 12:05:14,677 INFO : org.graylog2.system.shutdown.GracefulShutdown - Attempting to close input <org.graylog2.inputs.random.FakeHttpMessageInput.52d693bb300492055ae543f5> [Random HTTP message generator]. | |
2014-03-13 12:05:14,678 INFO : org.graylog2.system.shutdown.GracefulShutdown - Input [org.graylog2.inputs.random.FakeHttpMessageInput.52d693bb300492055ae543f5] closed. Took [0ms] | |
2014-03-13 12:05:14,678 INFO : org.graylog2.system.shutdown.GracefulShutdown - Attempting to close input <org.graylog2.inputs.gelf.udp.GELFUDPInput.52ddb63b300472bb4ed52012> [GELF UDP]. | |
2014-03-13 12:05:14,680 INFO : org.graylog2.system.shutdown.GracefulShutdown - Input [org.graylog2.inputs.gelf.udp.GELFUDPInput.52ddb63b300472bb4ed52012] closed. Took [2ms] | |
2014-03-13 12:05:14,681 INFO : org.graylog2.system.shutdown.GracefulShutdown - Att |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2.0.0p0 :001 > Time.now | |
=> 2014-02-21 19:41:13 +0100 | |
2.0.0p0 :002 > Time.now.utc.iso8601 | |
NoMethodError: undefined method `iso8601' for 2014-02-21 18:41:16 UTC:Time | |
from (irb):2 | |
from /Users/lennart/.rvm/rubies/ruby-2.0.0-p0/bin/irb:16:in `<main>' | |
2.0.0p0 :003 > require 'time' | |
=> true | |
2.0.0p0 :004 > Time.now.utc.iso8601 | |
=> "2014-02-21T18:41:20Z" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.graylog2.plugin.Message | |
rule "reproduce IRC issue" | |
when | |
m : Message( getField("message") matches "(?i).*mycrazystringtotrack(.|\n|\r)*" ) | |
then | |
m.addField("track", "crazystring" ); | |
System.out.println("matched!"); | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2014-01-11 17:40:14,349 DEBUG: org.graylog2.periodical.AlertScannerThread - Running alert checks. | |
2014-01-11 17:40:14,350 DEBUG: org.graylog2.periodical.AlertScannerThread - There are 1 streams with configured alert conditions. | |
2014-01-11 17:40:14,350 DEBUG: org.graylog2.periodical.AlertScannerThread - Stream [52d153f3300497641fae85c3: "Alerts test"] has [1] configured alert conditions. | |
2014-01-11 17:40:14,350 DEBUG: org.graylog2.alerts.AlertCondition - Checking alert condition [892e7056-7640-46c5-8def-8a7a5efdd59e:MESSAGE_COUNT={time: 1, threshold_type: more, threshold: 10, grace: 2}, stream:={52d153f3300497641fae85c3: "Alerts test"}] | |
2014-01-11 17:40:14,353 DEBUG: org.graylog2.alerts.types.MessageCountAlertCondition - Alert check <892e7056-7640-46c5-8def-8a7a5efdd59e> result: [20] | |
2014-01-11 17:40:14,353 INFO : org.graylog2.periodical.AlertScannerThread - Alert condition [892e7056-7640-46c5-8def-8a7a5efdd59e:MESSAGE_COUNT={time: 1, threshold_type: more, threshold: 10, grace: 2}, stream:={52d153f3300497641fa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RequiresAuthentication | |
@Api(value = "Streams", description = "Manage streams") | |
@Path("/streams") | |
public class StreamResource extends RestResource { | |
... | |
@PUT @Timed | |
@Path("/{streamId}") | |
@ApiOperation(value = "Update a stream") |