forked from ankitggits/SplunkJavaLogging
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRestEventData.java
More file actions
148 lines (132 loc) · 3.24 KB
/
RestEventData.java
File metadata and controls
148 lines (132 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
package com.splunk.logging;
/**
* A helper class to encapsulate URL parameters for submitting events to Splunk
* via REST endpoints
*
* @author Damien Dallimore damien@dtdsoftware.com
*
*/
public class RestEventData {
// REST URL parameter keys
public static String RECEIVERS_SIMPLE_ARG_INDEX = "index";
public static String RECEIVERS_SIMPLE_ARG_SOURCE = "source";
public static String RECEIVERS_SIMPLE_ARG_SOURCETYPE = "sourcetype";
public static String RECEIVERS_SIMPLE_ARG_HOST = "host";
public static String RECEIVERS_SIMPLE_ARG_HOSTREGEX = "host_regex";
// URL parameter values
private String source = "";
private String sourcetype = "";
private String index = "";
private String host = "";
private String hostRegex = "";
/**
* Default constructor
*/
public RestEventData() {
}
/**
* Constructor
*
* @param source
* The source value to fill in the metadata for this input's
* events.
* @param sourcetype
* The sourcetype to apply to events from this input.
* @param index
* The index to send events from this input to.
* @param host
* The value to populate in the host field for events from this
* data input.
* @param hostRegex
* A regular expression used to extract the host value from each
* event.
*/
public RestEventData(String source, String sourcetype, String index,
String host, String hostRegex) {
this.source = source;
this.sourcetype = sourcetype;
this.index = index;
this.host = host;
this.hostRegex = hostRegex;
}
/**
* The source value to fill in the metadata for this input's events.
*
* @return
*/
public String getSource() {
return source;
}
/**
* The source value to fill in the metadata for this input's events.
*
* @param source
*/
public void setSource(String source) {
this.source = source;
}
/**
* The sourcetype to apply to events from this input.
*
* @return
*/
public String getSourcetype() {
return sourcetype;
}
/**
* The sourcetype to apply to events from this input.
*
* @param sourcetype
*/
public void setSourcetype(String sourcetype) {
this.sourcetype = sourcetype;
}
/**
* The index to send events from this input to.
*
* @return
*/
public String getIndex() {
return index;
}
/**
* The index to send events from this input to.
*
* @param index
*/
public void setIndex(String index) {
this.index = index;
}
/**
* The value to populate in the host field for events from this data input.
*
* @return
*/
public String getHost() {
return host;
}
/**
* The value to populate in the host field for events from this data input.
*
* @param host
*/
public void setHost(String host) {
this.host = host;
}
/**
* A regular expression used to extract the host value from each event.
*
* @return
*/
public String getHostRegex() {
return hostRegex;
}
/**
* A regular expression used to extract the host value from each event.
*
* @param hostRegex
*/
public void setHostRegex(String hostRegex) {
this.hostRegex = hostRegex;
}
}