Debian Codegraph @

ansible_collections/splunk/es/docs/splunk.es.splunk_data_inputs_monitor_module.rst

raw
1 .. _splunk.es.splunk_data_inputs_monitor_module:
2
3
4 ************************************
5 splunk.es.splunk_data_inputs_monitor
6 ************************************
7
8 **Splunk Data Inputs of type Monitor resource module**
9
10
11 Version added: 2.1.0
12
13 .. contents::
14 :local:
15 :depth: 1
16
17
18 Synopsis
19 --------
20 - Module to add/modify or delete, File and Directory Monitor Data Inputs in Splunk.
21 - Tested against Splunk Enterprise Server 8.2.3
22
23
24
25
26 Parameters
27 ----------
28
29 .. raw:: html
30
31 <table border=0 cellpadding=0 class="documentation-table">
32 <tr>
33 <th colspan="2">Parameter</th>
34 <th>Choices/<font color="blue">Defaults</font></th>
35 <th width="100%">Comments</th>
36 </tr>
37 <tr>
38 <td colspan="2">
39 <div class="ansibleOptionAnchor" id="parameter-"></div>
40 <b>config</b>
41 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
42 <div style="font-size: small">
43 <span style="color: purple">list</span>
44 / <span style="color: purple">elements=dictionary</span>
45 </div>
46 </td>
47 <td>
48 </td>
49 <td>
50 <div>Configure file and directory monitoring on the system</div>
51 </td>
52 </tr>
53 <tr>
54 <td class="elbow-placeholder"></td>
55 <td colspan="1">
56 <div class="ansibleOptionAnchor" id="parameter-"></div>
57 <b>blacklist</b>
58 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
59 <div style="font-size: small">
60 <span style="color: purple">string</span>
61 </div>
62 </td>
63 <td>
64 </td>
65 <td>
66 <div>Specify a regular expression for a file path. The file path that matches this regular expression is not indexed.</div>
67 </td>
68 </tr>
69 <tr>
70 <td class="elbow-placeholder"></td>
71 <td colspan="1">
72 <div class="ansibleOptionAnchor" id="parameter-"></div>
73 <b>check_index</b>
74 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
75 <div style="font-size: small">
76 <span style="color: purple">boolean</span>
77 </div>
78 </td>
79 <td>
80 <ul style="margin: 0; padding: 0"><b>Choices:</b>
81 <li>no</li>
82 <li>yes</li>
83 </ul>
84 </td>
85 <td>
86 <div>If set to <code>true</code>, the index value is checked to ensure that it is the name of a valid index.</div>
87 <div>This parameter is not returned back by Splunk while obtaining object information. It is therefore left out while performing idempotency checks</div>
88 </td>
89 </tr>
90 <tr>
91 <td class="elbow-placeholder"></td>
92 <td colspan="1">
93 <div class="ansibleOptionAnchor" id="parameter-"></div>
94 <b>check_path</b>
95 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
96 <div style="font-size: small">
97 <span style="color: purple">boolean</span>
98 </div>
99 </td>
100 <td>
101 <ul style="margin: 0; padding: 0"><b>Choices:</b>
102 <li>no</li>
103 <li>yes</li>
104 </ul>
105 </td>
106 <td>
107 <div>If set to <code>true</code>, the name value is checked to ensure that it exists.</div>
108 <div>This parameter is not returned back by Splunk while obtaining object information. It is therefore left out while performing idempotency checks</div>
109 </td>
110 </tr>
111 <tr>
112 <td class="elbow-placeholder"></td>
113 <td colspan="1">
114 <div class="ansibleOptionAnchor" id="parameter-"></div>
115 <b>crc_salt</b>
116 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
117 <div style="font-size: small">
118 <span style="color: purple">string</span>
119 </div>
120 </td>
121 <td>
122 </td>
123 <td>
124 <div>A string that modifies the file tracking identity for files in this input. The magic value &lt;SOURCE&gt; invokes special behavior (see admin documentation).</div>
125 </td>
126 </tr>
127 <tr>
128 <td class="elbow-placeholder"></td>
129 <td colspan="1">
130 <div class="ansibleOptionAnchor" id="parameter-"></div>
131 <b>disabled</b>
132 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
133 <div style="font-size: small">
134 <span style="color: purple">boolean</span>
135 </div>
136 </td>
137 <td>
138 <ul style="margin: 0; padding: 0"><b>Choices:</b>
139 <li><div style="color: blue"><b>no</b>&nbsp;&larr;</div></li>
140 <li>yes</li>
141 </ul>
142 </td>
143 <td>
144 <div>Indicates if input monitoring is disabled.</div>
145 </td>
146 </tr>
147 <tr>
148 <td class="elbow-placeholder"></td>
149 <td colspan="1">
150 <div class="ansibleOptionAnchor" id="parameter-"></div>
151 <b>follow_tail</b>
152 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
153 <div style="font-size: small">
154 <span style="color: purple">boolean</span>
155 </div>
156 </td>
157 <td>
158 <ul style="margin: 0; padding: 0"><b>Choices:</b>
159 <li>no</li>
160 <li>yes</li>
161 </ul>
162 </td>
163 <td>
164 <div>If set to <code>true</code>, files that are seen for the first time is read from the end.</div>
165 </td>
166 </tr>
167 <tr>
168 <td class="elbow-placeholder"></td>
169 <td colspan="1">
170 <div class="ansibleOptionAnchor" id="parameter-"></div>
171 <b>host</b>
172 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
173 <div style="font-size: small">
174 <span style="color: purple">string</span>
175 </div>
176 </td>
177 <td>
178 <b>Default:</b><br/><div style="color: blue">"$decideOnStartup"</div>
179 </td>
180 <td>
181 <div>The value to populate in the host field for events from this data input.</div>
182 </td>
183 </tr>
184 <tr>
185 <td class="elbow-placeholder"></td>
186 <td colspan="1">
187 <div class="ansibleOptionAnchor" id="parameter-"></div>
188 <b>host_regex</b>
189 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
190 <div style="font-size: small">
191 <span style="color: purple">string</span>
192 </div>
193 </td>
194 <td>
195 </td>
196 <td>
197 <div>Specify a regular expression for a file path. If the path for a file matches this regular expression, the captured value is used to populate the host field for events from this data input. The regular expression must have one capture group.</div>
198 </td>
199 </tr>
200 <tr>
201 <td class="elbow-placeholder"></td>
202 <td colspan="1">
203 <div class="ansibleOptionAnchor" id="parameter-"></div>
204 <b>host_segment</b>
205 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
206 <div style="font-size: small">
207 <span style="color: purple">integer</span>
208 </div>
209 </td>
210 <td>
211 </td>
212 <td>
213 <div>Use the specified slash-separate segment of the filepath as the host field value.</div>
214 </td>
215 </tr>
216 <tr>
217 <td class="elbow-placeholder"></td>
218 <td colspan="1">
219 <div class="ansibleOptionAnchor" id="parameter-"></div>
220 <b>ignore_older_than</b>
221 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
222 <div style="font-size: small">
223 <span style="color: purple">string</span>
224 </div>
225 </td>
226 <td>
227 </td>
228 <td>
229 <div>Specify a time value. If the modification time of a file being monitored falls outside of this rolling time window, the file is no longer being monitored.</div>
230 <div>This parameter is not returned back by Splunk while obtaining object information. It is therefore left out while performing idempotency checks</div>
231 </td>
232 </tr>
233 <tr>
234 <td class="elbow-placeholder"></td>
235 <td colspan="1">
236 <div class="ansibleOptionAnchor" id="parameter-"></div>
237 <b>index</b>
238 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
239 <div style="font-size: small">
240 <span style="color: purple">string</span>
241 </div>
242 </td>
243 <td>
244 <b>Default:</b><br/><div style="color: blue">"default"</div>
245 </td>
246 <td>
247 <div>Which index events from this input should be stored in. Defaults to default.</div>
248 </td>
249 </tr>
250 <tr>
251 <td class="elbow-placeholder"></td>
252 <td colspan="1">
253 <div class="ansibleOptionAnchor" id="parameter-"></div>
254 <b>name</b>
255 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
256 <div style="font-size: small">
257 <span style="color: purple">string</span>
258 / <span style="color: red">required</span>
259 </div>
260 </td>
261 <td>
262 </td>
263 <td>
264 <div>The file or directory path to monitor on the system.</div>
265 </td>
266 </tr>
267 <tr>
268 <td class="elbow-placeholder"></td>
269 <td colspan="1">
270 <div class="ansibleOptionAnchor" id="parameter-"></div>
271 <b>recursive</b>
272 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
273 <div style="font-size: small">
274 <span style="color: purple">boolean</span>
275 </div>
276 </td>
277 <td>
278 <ul style="margin: 0; padding: 0"><b>Choices:</b>
279 <li>no</li>
280 <li>yes</li>
281 </ul>
282 </td>
283 <td>
284 <div>Setting this to False prevents monitoring of any subdirectories encountered within this data input.</div>
285 </td>
286 </tr>
287 <tr>
288 <td class="elbow-placeholder"></td>
289 <td colspan="1">
290 <div class="ansibleOptionAnchor" id="parameter-"></div>
291 <b>rename_source</b>
292 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
293 <div style="font-size: small">
294 <span style="color: purple">string</span>
295 </div>
296 </td>
297 <td>
298 </td>
299 <td>
300 <div>The value to populate in the source field for events from this data input. The same source should not be used for multiple data inputs.</div>
301 <div>This parameter is not returned back by Splunk while obtaining object information. It is therefore left out while performing idempotency checks</div>
302 </td>
303 </tr>
304 <tr>
305 <td class="elbow-placeholder"></td>
306 <td colspan="1">
307 <div class="ansibleOptionAnchor" id="parameter-"></div>
308 <b>sourcetype</b>
309 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
310 <div style="font-size: small">
311 <span style="color: purple">string</span>
312 </div>
313 </td>
314 <td>
315 </td>
316 <td>
317 <div>The value to populate in the sourcetype field for incoming events.</div>
318 </td>
319 </tr>
320 <tr>
321 <td class="elbow-placeholder"></td>
322 <td colspan="1">
323 <div class="ansibleOptionAnchor" id="parameter-"></div>
324 <b>time_before_close</b>
325 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
326 <div style="font-size: small">
327 <span style="color: purple">integer</span>
328 </div>
329 </td>
330 <td>
331 </td>
332 <td>
333 <div>When Splunk software reaches the end of a file that is being read, the file is kept open for a minimum of the number of seconds specified in this value. After this period has elapsed, the file is checked again for more data.</div>
334 <div>This parameter is not returned back by Splunk while obtaining object information. It is therefore left out while performing idempotency checks</div>
335 </td>
336 </tr>
337 <tr>
338 <td class="elbow-placeholder"></td>
339 <td colspan="1">
340 <div class="ansibleOptionAnchor" id="parameter-"></div>
341 <b>whitelist</b>
342 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
343 <div style="font-size: small">
344 <span style="color: purple">string</span>
345 </div>
346 </td>
347 <td>
348 </td>
349 <td>
350 <div>Specify a regular expression for a file path. Only file paths that match this regular expression are indexed.</div>
351 </td>
352 </tr>
353
354 <tr>
355 <td colspan="2">
356 <div class="ansibleOptionAnchor" id="parameter-"></div>
357 <b>running_config</b>
358 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
359 <div style="font-size: small">
360 <span style="color: purple">string</span>
361 </div>
362 </td>
363 <td>
364 </td>
365 <td>
366 <div>The module, by default, will connect to the remote device and retrieve the current running-config to use as a base for comparing against the contents of source. There are times when it is not desirable to have the task get the current running-config for every task in a playbook. The <em>running_config</em> argument allows the implementer to pass in the configuration to use as the base config for comparison. This value of this option should be the output received from device by executing command.</div>
367 </td>
368 </tr>
369 <tr>
370 <td colspan="2">
371 <div class="ansibleOptionAnchor" id="parameter-"></div>
372 <b>state</b>
373 <a class="ansibleOptionLink" href="#parameter-" title="Permalink to this option"></a>
374 <div style="font-size: small">
375 <span style="color: purple">string</span>
376 </div>
377 </td>
378 <td>
379 <ul style="margin: 0; padding: 0"><b>Choices:</b>
380 <li><div style="color: blue"><b>merged</b>&nbsp;&larr;</div></li>
381 <li>replaced</li>
382 <li>deleted</li>
383 <li>gathered</li>
384 </ul>
385 </td>
386 <td>
387 <div>The state the configuration should be left in</div>
388 </td>
389 </tr>
390 </table>
391 <br/>
392
393
394
395
396 Examples
397 --------
398
399 .. code-block:: yaml
400
401 # Using gathered
402 # --------------
403
404 - name: Gather config for specified Data inputs monitors
405 splunk.es.splunk_data_inputs_monitor:
406 config:
407 - name: "/var/log"
408 - name: "/var"
409 state: gathered
410
411 # RUN output:
412 # -----------
413
414 # "gathered": [
415 # {
416 # "blacklist": "//var/log/[a-z0-9]/gm",
417 # "crc_salt": "<SOURCE>",
418 # "disabled": false,
419 # "host": "$decideOnStartup",
420 # "host_regex": "/(test_host)/gm",
421 # "host_segment": 3,
422 # "index": "default",
423 # "name": "/var/log",
424 # "recursive": true,
425 # "sourcetype": "test_source",
426 # "whitelist": "//var/log/[0-9]/gm"
427 # }
428 # ]
429 #
430
431 # Using merged
432 # ------------
433
434 - name: Update Data inputs monitors config
435 splunk.es.splunk_data_inputs_monitor:
436 config:
437 - name: "/var/log"
438 blacklist: "//var/log/[a-z]/gm"
439 check_index: true
440 check_path: true
441 crc_salt: <SOURCE>
442 rename_source: "test"
443 whitelist: "//var/log/[0-9]/gm"
444 state: merged
445
446 # RUN output:
447 # -----------
448
449 # "after": [
450 # {
451 # "blacklist": "//var/log/[a-z]/gm",
452 # "crc_salt": "<SOURCE>",
453 # "disabled": false,
454 # "host": "$decideOnStartup",
455 # "host_regex": "/(test_host)/gm",
456 # "host_segment": 3,
457 # "index": "default",
458 # "name": "/var/log",
459 # "recursive": true,
460 # "sourcetype": "test_source",
461 # "whitelist": "//var/log/[0-9]/gm"
462 # }
463 # ],
464 # "before": [
465 # {
466 # "blacklist": "//var/log/[a-z0-9]/gm",
467 # "crc_salt": "<SOURCE>",
468 # "disabled": false,
469 # "host": "$decideOnStartup",
470 # "host_regex": "/(test_host)/gm",
471 # "host_segment": 3,
472 # "index": "default",
473 # "name": "/var/log",
474 # "recursive": true,
475 # "sourcetype": "test_source",
476 # "whitelist": "//var/log/[0-9]/gm"
477 # }
478 # ],
479
480 # Using replaced
481 # --------------
482
483 - name: To Replace Data inputs monitors config
484 splunk.es.splunk_data_inputs_monitor:
485 config:
486 - name: "/var/log"
487 blacklist: "//var/log/[a-z0-9]/gm"
488 crc_salt: <SOURCE>
489 index: default
490 state: replaced
491
492 # RUN output:
493 # -----------
494
495 # "after": [
496 # {
497 # "blacklist": "//var/log/[a-z0-9]/gm",
498 # "crc_salt": "<SOURCE>",
499 # "disabled": false,
500 # "host": "$decideOnStartup",
501 # "index": "default",
502 # "name": "/var/log"
503 # }
504 # ],
505 # "before": [
506 # {
507 # "blacklist": "//var/log/[a-z0-9]/gm",
508 # "crc_salt": "<SOURCE>",
509 # "disabled": false,
510 # "host": "$decideOnStartup",
511 # "host_regex": "/(test_host)/gm",
512 # "host_segment": 3,
513 # "index": "default",
514 # "name": "/var/log",
515 # "recursive": true,
516 # "sourcetype": "test_source",
517 # "whitelist": "//var/log/[0-9]/gm"
518 # }
519 # ],
520
521 # Using deleted
522 # -----------
523 - name: To Delete Data inpur monitor config
524 splunk.es.splunk_data_inputs_monitor:
525 config:
526 - name: "/var/log"
527 state: deleted
528
529 # RUN output:
530 # -----------
531 #
532 # "after": [],
533 # "before": [
534 # {
535 # "blacklist": "//var/log/[a-z0-9]/gm",
536 # "crc_salt": "<SOURCE>",
537 # "disabled": false,
538 # "host": "$decideOnStartup",
539 # "index": "default",
540 # "name": "/var/log"
541 # }
542 # ],
543
544
545
546 Return Values
547 -------------
548 Common return values are documented `here <https://docs.ansible.com/ansible/latest/reference_appendices/common_return_values.html#common-return-values>`_, the following are the fields unique to this module:
549
550 .. raw:: html
551
552 <table border=0 cellpadding=0 class="documentation-table">
553 <tr>
554 <th colspan="1">Key</th>
555 <th>Returned</th>
556 <th width="100%">Description</th>
557 </tr>
558 <tr>
559 <td colspan="1">
560 <div class="ansibleOptionAnchor" id="return-"></div>
561 <b>after</b>
562 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
563 <div style="font-size: small">
564 <span style="color: purple">list</span>
565 </div>
566 </td>
567 <td>when changed</td>
568 <td>
569 <div>The configuration as structured data after module completion.</div>
570 <br/>
571 <div style="font-size: smaller"><b>Sample:</b></div>
572 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format of the parameters above.</div>
573 </td>
574 </tr>
575 <tr>
576 <td colspan="1">
577 <div class="ansibleOptionAnchor" id="return-"></div>
578 <b>before</b>
579 <a class="ansibleOptionLink" href="#return-" title="Permalink to this return value"></a>
580 <div style="font-size: small">
581 <span style="color: purple">list</span>
582 </div>
583 </td>
584 <td>always</td>
585 <td>
586 <div>The configuration as structured data prior to module invocation.</div>
587 <br/>
588 <div style="font-size: smaller"><b>Sample:</b></div>
589 <div style="font-size: smaller; color: blue; word-wrap: break-word; word-break: break-all;">The configuration returned will always be in the same format of the parameters above.</div>
590 </td>
591 </tr>
592 </table>
593 <br/><br/>
594
595
596 Status
597 ------
598
599
600 Authors
601 ~~~~~~~
602
603 - Ansible Security Automation Team (@pranav-bhatt) <https://github.com/ansible-security>