-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* sys logs from kafka through file beats implementation * updated change log
- Loading branch information
1 parent
51742ed
commit 1edcd4e
Showing
4 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
type="a" | ||
message="Added new Beats Kafka input to ingest system logs from Kafka topic using Filebeat." | ||
|
||
issues=["5254"] | ||
pulls=["20067"] |
72 changes: 72 additions & 0 deletions
72
graylog2-server/src/main/java/org/graylog2/inputs/beats/kafka/BeatsKafkaInput.java
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* | ||
* Copyright (C) 2020 Graylog, Inc. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the Server Side Public License, version 1, | ||
* as published by MongoDB, Inc. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* Server Side Public License for more details. | ||
* | ||
* You should have received a copy of the Server Side Public License | ||
* along with this program. If not, see | ||
* <http://www.mongodb.com/licensing/server-side-public-license>. | ||
*/ | ||
package org.graylog2.inputs.beats.kafka; | ||
|
||
import com.codahale.metrics.MetricRegistry; | ||
import com.google.inject.assistedinject.Assisted; | ||
import com.google.inject.assistedinject.AssistedInject; | ||
import jakarta.inject.Inject; | ||
import org.graylog.plugins.beats.Beats2Codec; | ||
import org.graylog2.inputs.transports.KafkaTransport; | ||
import org.graylog2.plugin.LocalMetricRegistry; | ||
import org.graylog2.plugin.ServerStatus; | ||
import org.graylog2.plugin.configuration.Configuration; | ||
import org.graylog2.plugin.inputs.MessageInput; | ||
import org.graylog2.plugin.inputs.annotations.ConfigClass; | ||
import org.graylog2.plugin.inputs.annotations.FactoryClass; | ||
|
||
public class BeatsKafkaInput extends MessageInput { | ||
private static final String NAME = "Beats Kafka"; | ||
|
||
@AssistedInject | ||
public BeatsKafkaInput(@Assisted Configuration configuration, | ||
MetricRegistry metricRegistry, | ||
KafkaTransport.Factory transport, | ||
Beats2Codec.Factory codec, | ||
LocalMetricRegistry localRegistry, | ||
Config config, | ||
Descriptor descriptor, ServerStatus serverStatus) { | ||
super(metricRegistry, configuration, transport.create(configuration), localRegistry, codec.create(configuration), config, descriptor, serverStatus); | ||
} | ||
|
||
@FactoryClass | ||
public interface Factory extends MessageInput.Factory<BeatsKafkaInput> { | ||
@Override | ||
BeatsKafkaInput create(Configuration configuration); | ||
|
||
@Override | ||
Config getConfig(); | ||
|
||
@Override | ||
Descriptor getDescriptor(); | ||
} | ||
|
||
public static class Descriptor extends MessageInput.Descriptor { | ||
@Inject | ||
public Descriptor() { | ||
super(NAME, false, ""); | ||
} | ||
} | ||
|
||
@ConfigClass | ||
public static class Config extends MessageInput.Config { | ||
@Inject | ||
public Config(KafkaTransport.Factory transport, Beats2Codec.Factory codec) { | ||
super(transport.getConfig(), codec.getConfig()); | ||
} | ||
} | ||
} |
This file contains 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
This file contains 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