@@ -68,13 +68,13 @@ public Job dispatch() throws InterruptedException {
68
68
* Runs the saved search using dispatch arguments.
69
69
*
70
70
* @param args Dispatch arguments: <ul>
71
- * <li>"dispatch.now": A time string that is used to dispatch the search as
71
+ * <li>"dispatch.now": A time string that is used to dispatch the search as
72
72
* though the specified time were the current time.</li>
73
- * <li>"dispatch.*": Overwrites the value of the search field specified in
73
+ * <li>"dispatch.*": Overwrites the value of the search field specified in
74
74
* "*".</li>
75
- * <li>"trigger_actions": A Boolean that indicates whether to trigger alert
75
+ * <li>"trigger_actions": A Boolean that indicates whether to trigger alert
76
76
* actions.</li>
77
- * <li>"force_dispatch": A Boolean that indicates whether to start a new
77
+ * <li>"force_dispatch": A Boolean that indicates whether to start a new
78
78
* search if another instance of this search is already running.</li></ul>
79
79
* @return The search job.
80
80
* @throws InterruptedException The InterruptedException instance
@@ -93,7 +93,7 @@ public Job dispatch(Map args) throws InterruptedException {
93
93
94
94
return job ;
95
95
}
96
-
96
+
97
97
/**
98
98
* Runs the saved search using dispatch arguments.
99
99
*
@@ -114,6 +114,28 @@ public Job dispatch(SavedSearchDispatchArgs args) throws InterruptedException {
114
114
*/
115
115
public Job [] history () {
116
116
ResponseMessage response = service .get (actionPath ("history" ));
117
+ AtomFeed feed ;
118
+ return parseHistoryResponse (response );
119
+ }
120
+
121
+ /**
122
+ * Returns an array of search jobs based on passed search arguments
123
+ *
124
+ * @param args
125
+ * @return An array of search jobs
126
+ */
127
+ public Job [] history (Map <String , Object > args ) {
128
+ ResponseMessage response = service .get (actionPath ("history" ), args );
129
+ return parseHistoryResponse (response );
130
+ }
131
+
132
+ /**
133
+ * Parses response message from history action path
134
+ *
135
+ * @param response
136
+ * @return result An array of Job
137
+ */
138
+ private Job [] parseHistoryResponse (final ResponseMessage response ) {
117
139
AtomFeed feed ;
118
140
try {
119
141
feed = AtomFeed .parseStream (response .getContent ());
@@ -170,7 +192,7 @@ public String getActionEmailCc() {
170
192
* <p>
171
193
* Generally, this command is a template search pipeline that is realized
172
194
* with values from the saved search. To reference saved search field
173
- * values, wrap them in "$". For example, use "$name$" to reference the
195
+ * values, wrap them in "$". For example, use "$name$" to reference the
174
196
* saved search name, or use "$search$" to reference the search query.
175
197
*
176
198
* @return The search command (or pipeline).
@@ -630,7 +652,7 @@ public String getActionSummaryIndexName() {
630
652
* <p>
631
653
* Generally, this command is a template search pipeline that is realized
632
654
* with values from the saved search. To reference saved search field
633
- * values, wrap them in "$". For example, use "$name$" to reference the
655
+ * values, wrap them in "$". For example, use "$name$" to reference the
634
656
* saved search name, or use "$search$" to reference the search query.
635
657
*
636
658
* @return The search command (or pipeline).
@@ -906,7 +928,7 @@ public int getDispatchMaxCount() {
906
928
public int getDispatchMaxTime () {
907
929
return getInteger ("dispatch.max_time" );
908
930
}
909
-
931
+
910
932
/**
911
933
* Returns how frequently Splunk runs the MapReduce reduce phase
912
934
* on accumulated map values.
@@ -928,7 +950,7 @@ public int getDispatchReduceFrequency() {
928
950
public boolean getDispatchRtBackfill () {
929
951
return getDispatchRealTimeBackfill ();
930
952
}
931
-
953
+
932
954
/**
933
955
* Indicates whether to back fill the real-time window for this search.
934
956
* This attribute only applies to real-time searches.
@@ -1235,7 +1257,7 @@ public void setActionEmailCc(String cc) {
1235
1257
* <p>
1236
1258
* Generally, this command is a template search pipeline that is realized
1237
1259
* with values from the saved search. To reference saved search field
1238
- * values, wrap them in "$". For example, use "$name$" to reference the
1260
+ * values, wrap them in "$". For example, use "$name$" to reference the
1239
1261
* saved search name, or use "$search$" to reference the search query.
1240
1262
*
1241
1263
* @param command The search command (or pipeline).
@@ -1547,7 +1569,7 @@ public void setActionPopulateLookupTtl(String ttl) {
1547
1569
* <p>
1548
1570
* Generally, this command is a template search pipeline that is realized
1549
1571
* with values from the saved search. To reference saved search field
1550
- * values, wrap them in "$". For example, use "$name$" to reference the
1572
+ * values, wrap them in "$". For example, use "$name$" to reference the
1551
1573
* saved search name, or use "$search$" to reference the search query.
1552
1574
*
1553
1575
* @param command The search command (or pipeline).
@@ -1614,7 +1636,7 @@ public void setActionRssTtl(String ttl) {
1614
1636
* <p>
1615
1637
* Generally, this command is a template search pipeline that is realized
1616
1638
* with values from the saved search. To reference saved search field
1617
- * values, wrap them in "$". For example, use "$name$" to reference the
1639
+ * values, wrap them in "$". For example, use "$name$" to reference the
1618
1640
* saved search name, or use "$search$" to reference the search query.
1619
1641
*
1620
1642
* @param command The search command (or pipeline).
@@ -1702,7 +1724,7 @@ public void setActionSummaryIndexName(String name) {
1702
1724
* <p>
1703
1725
* Generally, this command is a template search pipeline that is realized
1704
1726
* with values from the saved search. To reference saved search field
1705
- * values, wrap them in "$". For example, use "$name$" to reference the
1727
+ * values, wrap them in "$". For example, use "$name$" to reference the
1706
1728
* saved search name, or use "$search$" to reference the search query.
1707
1729
*
1708
1730
* @param command The search command (or pipeline).
@@ -1954,7 +1976,7 @@ public void setDisabled(boolean disabled) {
1954
1976
public void setDispatchBuckets (String buckets ) {
1955
1977
setDispatchBuckets (Integer .parseInt (buckets ));
1956
1978
}
1957
-
1979
+
1958
1980
/**
1959
1981
* Sets the maximum number of timeline buckets.
1960
1982
*
@@ -2161,7 +2183,7 @@ public void setRequestUiDispatchView(String view) {
2161
2183
public void setRestartOnSearchpeerAdd (boolean restart ) {
2162
2184
setRestartOnSearchPeerAdd (restart );
2163
2185
}
2164
-
2186
+
2165
2187
/**
2166
2188
* Sets whether a real-time search managed by the scheduler is
2167
2189
* restarted when a search peer becomes available for this saved search.
0 commit comments