public class SplunkResourceManager extends TestContainerResourceManager<SplunkContainer> implements org.apache.beam.it.common.ResourceManager
The class supports one Splunk server instance.
The class is thread-safe.
Note: The Splunk TestContainer will only run on M1 Mac's if the Docker version is >= 4.16.0 and the "Use Rosetta for x86/amd64 emulation on Apple Silicon" setting is enabled.
Modifier and Type | Class and Description |
---|---|
static class |
SplunkResourceManager.Builder
Builder for
SplunkResourceManager . |
HOST_IP, port
Modifier and Type | Method and Description |
---|---|
static SplunkResourceManager.Builder |
builder(java.lang.String testId) |
java.util.List<SplunkEvent> |
getEvents()
Return a list of all Splunk events retrieved from the Splunk server.
|
java.util.List<SplunkEvent> |
getEvents(java.lang.String query)
Return a list of Splunk events retrieved from the Splunk server based on the given query.
|
java.lang.String |
getHecEndpoint()
Returns the HTTP Event Collector (HEC) endpoint that this Splunk server is configured to
receive events at.
|
java.lang.String |
getHecToken()
Returns the Splunk Http Event Collector (HEC) authentication token used to connect to this
Splunk instance's HEC service.
|
java.lang.String |
getHttpEndpoint()
Returns the HTTP endpoint that this Splunk server is configured to listen on.
|
boolean |
sendHttpEvent(SplunkEvent event)
Sends the given HTTP event to the Splunk Http Event Collector (HEC) service.
|
boolean |
sendHttpEvents(java.util.Collection<SplunkEvent> events)
Sends the given HTTP events to the Splunk Http Event Collector (HEC) service.
|
cleanupAll, getDockerImageName, getHost, getPort
public static SplunkResourceManager.Builder builder(java.lang.String testId)
public java.lang.String getHttpEndpoint()
public java.lang.String getHecEndpoint()
This will be the HTTP endpoint concatenated with '/services/collector/event'
.
public java.lang.String getHecToken()
public boolean sendHttpEvent(SplunkEvent event)
Note: Setting the index
field in the Splunk event requires the index already
being configured in the Splunk instance. Unless using a static Splunk instance, omit this field
from the event.
event
- The SpunkEvent to send to the HEC service.public boolean sendHttpEvents(java.util.Collection<SplunkEvent> events)
Note: Setting the index
field in the Splunk event requires the index already
being configured in the Splunk instance. Unless using a static Splunk instance, omit this field
from the events.
events
- The SpunkEvents to send to the HEC service.public java.util.List<SplunkEvent> getEvents()
public java.util.List<SplunkEvent> getEvents(java.lang.String query)
e.g. query: 'search source=mySource sourcetype=mySourceType host=myHost'
query
- The query to filter events by.