SPLK-1002
Free SPLK-1002 practice questions
10 questions from our SPLK-1002 practice tests, each with the correct answer and a written explanation. Read them with the answers shown, or switch to quiz mode and answer first.
Question 1 of 10, Using Transforming Commands for Visualizations
An analyst needs a line chart that shows the number of web errors per hour over the last 24 hours, with one line for each value of the host field. Which search produces results in the correct shape for that visualization?
- Aindex=web status>=500 | timechart span=1h count by host Correct answer
- Bindex=web status>=500 | top limit=24 host by date_hour
- Cindex=web status>=500 | bin _time span=1h | stats count by host, _time
- Dindex=web status>=500 | chart count over host span=1h
Answer and explanation: timechart buckets _time into the given span and splits the count into one column per host, which is exactly the series layout a line chart needs. bin plus stats counts the same buckets but returns one row per host and hour instead of one column per host, so the chart cannot draw a line per host without further reshaping. chart over host puts host on the x-axis instead of time, and top returns the most common values with percentages rather than a time series.
Question 2 of 10, Filtering and Formatting Results
An eval must set a field named severity to high when status is 500 or greater, medium when status is between 400 and 499, and low for everything else. Which expression is correct?
- A| eval severity=case(status>=500,"high",status>=400,"medium",true(),"low") Correct answer
- B| eval severity=coalesce(status>=500,"high",status>=400,"medium")
- C| eval severity=if(status>=500,"high",status>=400,"medium","low")
- D| eval severity=case(status>=400,"medium",status>=500,"high",1=1,"low",status<400,"low")
Answer and explanation: case() evaluates condition/value pairs in order and returns the first match, and true() as the last condition provides the default. if() accepts exactly three arguments, so the five-argument form is invalid. Putting status>=400 first (even with extra fallback pairs) means a 503 matches medium before the high test is reached, and coalesce() returns the first non-null argument rather than testing conditions.
Question 3 of 10, Correlating Events
A login workflow writes an event containing "login attempt" and later an event containing "login success". The analyst wants transactions that begin with the attempt and finish with the success for the same user. Which search is correct?
- A| transaction user maxevents=2 keeporphans=true
- B| transaction startswith=user endswith="login success"
- C| transaction user startswith="login attempt" endswith="login success" Correct answer
- D| stats earliest("login attempt") latest("login success") by user
Answer and explanation: startswith and endswith accept search terms or eval expressions that define the first and last event of each transaction, and grouping by user keeps different users apart. maxevents=2 with keeporphans only caps size and keeps unmatched events, so it never checks the event content. startswith=user uses the literal text user instead of the field, and earliest()/latest() take field names, not search strings.
Question 4 of 10, Creating and Managing Fields
A user wants to extract a field from events that have no consistent delimiter but follow a recognizable text pattern. In the Field Extractor, which method should be chosen?
- ARegular Expression Correct answer
- BLookup definition
- CDelimiters
- DAutomatic key-value
Answer and explanation: The Field Extractor offers two methods: Regular Expression for unstructured text with a pattern, and Delimiters for data separated by a character such as a comma or tab. Delimiters would not work when there is no consistent separator. Automatic key-value extraction is a search-time default, not a Field Extractor method, and lookups add fields from external tables rather than extracting them from events.
Question 5 of 10, Creating Field Aliases and Calculated Fields
An analyst wants a calculated field that returns the value of user if present, otherwise the value of username, otherwise the string unknown. Which eval expression should the calculated field use?
- Anullif(user, username, "unknown")
- Bif(isnull(user), username, "unknown")
- Ccoalesce(user, username, "unknown") Correct answer
- Dcase(user, username, true(), "unknown")
Answer and explanation: coalesce() returns the first argument that is not null, so it checks user, then username, then falls back to the literal unknown. The if() version returns unknown whenever user exists, which is backwards. case() expects boolean conditions, not field values, and nullif() compares two values and returns null when they are equal, taking only two arguments.
Question 6 of 10, Creating Tags and Event Types
An event type named vpn_login uses the search sourcetype=vpn action=login. The team tags the event type with remote_access. Which search will return those events using the tag?
- Aeventtype=remote_access
- Btag::sourcetype=remote_access
- Ctag=remote_access Correct answer
- Dtag::action=remote_access
Answer and explanation: Tags applied to an event type are attached to the eventtype=vpn_login field/value pair, so tag=remote_access (or tag::eventtype=remote_access) finds the events. eventtype=remote_access looks for an event type named remote_access, which does not exist. The tag was not applied to the sourcetype or action field values, so those field-specific tag searches return nothing.
Question 7 of 10, Creating and Using Macros
A macro latency_over(1) takes an argument ms that must be a number. The team wants Splunk to reject invocations such as latency_over(abc) with a clear message. What should be configured on the macro?
- AThe Use eval-based definition option with the expression tonumber($ms$)
- BRead-only permissions so that only admins can pass arguments
- CA validation expression such as isnum(ms) with an error message Correct answer
- DAn argument default value of 0 that replaces non-numeric input
Answer and explanation: A macro's validation expression is an eval expression evaluated against the arguments, and if it returns false, Splunk shows the configured validation error message instead of running the search. The eval-based definition option changes how the definition is produced, not whether input is checked. Macros do not support argument default values in their definition, and permissions do not validate input.
Question 8 of 10, Creating and Using Workflow Actions
A workflow action should be offered only for events that match the event type firewall_deny, regardless of which field the user opens. Which setting achieves this?
- AOpen link in: New window with the search string eventtype=firewall_deny
- BShow action in: Event menu with the URI set to $eventtype$
- CApply only to the following event types: firewall_deny Correct answer
- DApply only to the following fields: eventtype
Answer and explanation: The event type restriction limits a workflow action to events tagged with the listed event types. Restricting to the eventtype field only controls which field menu shows the action and does not filter by value. Putting $eventtype$ in the URI uses the value but still shows the action for every event, and the link target and search string do not restrict where the action appears.
Question 9 of 10, Creating Data Models
An analyst needs a quick count of 404 responses by client from the accelerated Web data model. Which search uses the model's summaries most efficiently?
- A| tstats count from datamodel=Web where Web.status=404 by Web.src Correct answer
- B| pivot Web Web count(Web) AS count FILTER status is 404
- C| datamodel Web Web search | search status=404 | stats count by src
- Dindex=* tag=web status=404 | stats count by src | sort - count
Answer and explanation: tstats reads the tsidx summaries of an accelerated data model directly and is the fastest way to aggregate over it; field names use the dataset prefix such as Web.status. The datamodel command returns events and then stats processes them, which is slower. Searching raw indexes ignores the summaries entirely, and the pivot command example lacks a split and is not the most efficient approach for this aggregation.
Question 10 of 10, Using the Common Information Model (CIM) Add-On
An analyst normalized a new data source and wants to verify that events now populate the CIM Web data model with the expected fields. Which approach is appropriate?
- ARun | inputlookup Web and look for the new source type in the lookup rows
- BOpen the CIM add-on documentation and compare its Web field list with a sample event
- CRun | datamodel Web Web search and check the Web.* fields for the new source type Correct answer
- DConfirm under Settings > Data inputs that the new source type is still receiving data
Answer and explanation: Searching the data model with the datamodel command (or using Pivot or tstats) shows whether events from the new source meet the constraints and which CIM fields are populated. Web is a data model, not a lookup, so inputlookup does not apply. Data inputs only show whether data is being collected, and reading documentation does not test the actual events.