public class InputDefinition extends Object
InputDefinition
class encodes the XML defining inputs that Splunk passes to
a modular input script as a Java object.Modifier and Type | Method and Description |
---|---|
void |
addInput(String name,
Collection<Parameter> parameters)
Adds an input to the set of inputs on this
InputDefinition . |
boolean |
equals(Object other) |
String |
getCheckpointDir()
Gets the path to which to write checkpoint files for restarting inputs.
|
String |
getField(String fieldName)
Gets the name of the field to fetch.
|
Map<String,Map<String,Parameter>> |
getInputs() |
String |
getServerHost()
Gets the name of the server on which this modular input is being run.
|
String |
getServerUri()
Gets the URI to the server on which this modular input is being run.
|
String |
getSessionKey()
Sets a session providing access to splunkd's REST API on this host.
|
int |
hashCode() |
static InputDefinition |
parseDefinition(InputStream stream)
Parses a stream containing XML into an InputDefinition.
|
void |
setCheckpointDir(String checkpointDir)
Sets the path to which to write checkpoint files.
|
void |
setServerHost(String serverHost)
Sets the name of the server on which this modular input is being run.
|
void |
setServerUri(String serverUri)
Sets the URI to reach the server on which this modular input is being run.
|
void |
setSessionKey(String sessionKey)
Sets a session key that can be used to access splunkd's REST API.
|
public String getField(String fieldName)
InputDefinition
. getField
permits
access to them in case you are constrained to an old version of the Splunk SDK for Java.fieldName
- The name of the field to fetch.public void setServerHost(String serverHost)
serverHost
- String valuepublic String getServerHost()
public void setServerUri(String serverUri)
serverUri
- The URI to reach the server on which this modular input is being run.public String getServerUri()
public void setCheckpointDir(String checkpointDir)
checkpointDir
- The path to which to write checkpoint files.public String getCheckpointDir()
public void setSessionKey(String sessionKey)
sessionKey
- A session key that can be used to access splunkd's REST API.public String getSessionKey()
public void addInput(String name, Collection<Parameter> parameters)
InputDefinition
.name
- The name of this input (e.g., foobar://this-input-name).parameters
- A collection of Parameter
objects giving the settings for this input.public Map<String,Map<String,Parameter>> getInputs()
InputDefinition
.public static InputDefinition parseDefinition(InputStream stream) throws ParserConfigurationException, IOException, SAXException, MalformedDataException
stream
- The stream containing XML to parse.InputDefinition
object.ParserConfigurationException
- If there are errors in setting up the parser (which indicates system
configuration issues).IOException
- If there is an error in reading from the stream.SAXException
- When the XML is invalid.MalformedDataException
- When the XML does specify a valid set of inputs.Copyright © 2022 Splunk, Inc.. All rights reserved.