ExamGecko
Question list
Search
Search

Question 178 - SPLK-1003 discussion

Report
Export

Which file will be matched for the following monitor stanza in inputs. conf?

A.
[monitor: ///var/log/*/bar/*. txt]
Answers
A.
[monitor: ///var/log/*/bar/*. txt]
B.
/var/log/host_460352847/temp/bar/file/csv/foo.txt
Answers
B.
/var/log/host_460352847/temp/bar/file/csv/foo.txt
C.
/var/log/host_460352847/bar/foo.txt
Answers
C.
/var/log/host_460352847/bar/foo.txt
D.
/var/log/host_460352847/bar/file/foo.txt
Answers
D.
/var/log/host_460352847/bar/file/foo.txt
E.
/var/ log/ host_460352847/temp/bar/file/foo.txt
Answers
E.
/var/ log/ host_460352847/temp/bar/file/foo.txt
Suggested answer: C

Explanation:

The correct answer is C. /var/log/host_460352847/bar/file/foo.txt.

The monitor stanza in inputs.conf is used to configure Splunk to monitor files and directories for new data. The monitor stanza has the following syntax1:

[monitor://<input path>]

The input path can be a file or a directory, and it can include wildcards (*) and regular expressions. The wildcards match any number of characters, including none, while the regular expressions match patterns of characters. The input path is case-sensitive and must be enclosed in double quotes if it contains spaces1.

In this case, the input path is /var/log//bar/.txt, which means Splunk will monitor any file with the .txt extension that is located in a subdirectory named bar under the /var/log directory. The subdirectory bar can be at any level under the /var/log directory, and the * wildcard will match any characters before or after the bar and .txt parts1.

Therefore, the file /var/log/host_460352847/bar/file/foo.txt will be matched by the monitor stanza, as it meets the criteria. The other files will not be matched, because:

A) /var/log/host_460352847/temp/bar/file/csv/foo.txt has a .csv extension, not a .txt extension.

B) /var/log/host_460352847/bar/foo.txt is not located in a subdirectory under the bar directory, but directly in the bar directory.

D) /var/log/host_460352847/temp/bar/file/foo.txt is located in a subdirectory named file under the bar directory, not directly in the bar directory.


asked 23/09/2024
Gufran Dalwai
46 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first