Splunk certification · Exam SPLK-1002

SPLK-1002 Mock Exam Page 7

Splunk Core Certified Power User Exam

Free SPLK-1002 mock exam questions 61–70, each with the answer and an explanation.

20 questions · 33 minutes · free, no sign-up

Free SPLK-1002 questions

61–70 of 91 free
Question 61 Choose 1
How is a variable for a macro defined?
Show answerHide answer

Correct answer: C Place the variable name inside of dollar signs: $variable name$.

Explanation

Explanation

When defining a macro with arguments, you reference those arguments inside the macro definition by enclosing them in dollar signs ($). The dollar sign format is $arg1$ or $argument_name$ (if using named arguments). This tells Splunk to substitute the actual value passed to the macro when it is called.

❌ Why the other options are incorrect

A. Place the variable name inside of curly braces: {variable_name}. – Curly braces are used in other contexts (e.g., where with field names), but they are not used for macro variable syntax. Macro arguments require dollar signs, not curly braces.

B. Place the variable name inside of asterisks: variable_name. – Asterisks are used as wildcards in search patterns (e.g., error*), but they are not used for macro variable substitution.

D. Place the variable name inside of percentage signs: %variable_name%. – Percentage signs are not used for macro variables in Splunk. This is a distractor.

Splunk Documentation:

"In the macro definition, you reference the arguments with dollar signs, such as 1 or argume ntnameargument n ​ ame."
Question 62 Choose 1
Which is not a comparison operator in Splunk?
Show answerHide answer

Correct answer: E ?=

Explanation

Explanation

The ?= symbol is not a valid comparison operator in Splunk. Splunk supports a standard set of comparison operators for filtering and evaluating events, including:

= (equal to)
!= (not equal to)
> (greater than)
< (less than)
>= (greater than or equal to)
<= (less than or equal to)

These operators are used in commands like where, search, and conditional eval expressions. The ?= operator does not exist in Splunk's search syntax. It may appear in other languages (e.g., Perl, regex) but is not recognized by Splunk's search processing language.

❌ Why the other options are incorrect

A. <=– This is a valid comparison operator meaning "less than or equal to." Example: | where bytes <= 1024

B. = – This is a valid comparison operator meaning "equal to." It is the most commonly used operator for field‑value comparisons. Example: status=404

C. != – This is a valid comparison operator meaning "not equal to." Example: | where status != 200

D. > – This is a valid comparison operator meaning "greater than." Example: | where bytes > 1000

All of these operators are documented and widely used in Splunk searches. The only invalid one is ?=, which has no function in Splunk SPL.

References

Splunk Documentation:
"Splunk supports the following comparison operators: =, !=, <, >, <=, >=."
Question 63 Choose 2
Which of the following searches show a valid use of a macro? (Choose all that apply.)
Show answerHide answer

Correct answer: A, C index=main source=mySource oldField=* |’makeMyField(oldField)’| table _time newFieldindex=main source=mySource oldField=* | eval newField=’makeMyField(oldField)’| table _time newField

Explanation

Explanation

A macro in Splunk is called by enclosing the macro name and its arguments in backticks (`). The macro can be used as a standalone command or within an eval expression.

A. index=main source=mySource oldField=* | 'makeMyField(oldField)' | table _time newField
✅ This is a valid use. The macro is called as a standalone command (pipe), and the backticks are correctly placed around makeMyField(oldField). (Note: In the question, the backticks appear as single quotes ', but the intent is clearly a macro call.)

C. index=main source=mySource oldField=* | eval newField='makeMyField(oldField)' | table _time newField
✅ This is also valid. The macro is used inside an eval expression to assign the result to a new field newField. Macros can be embedded within eval when they return a value or expression.

❌ Why the other options are incorrect

B. index=main source=mySource oldField=* | stats if('makeMyField(oldField)') | table _time newField
❌ The stats command requires aggregation functions (e.g., count, sum, avg) or field names. Using a macro inside stats with if() is syntactically incorrect unless the macro expands to a valid aggregation expression. Additionally, stats with if() does not produce a field named newField for table to display.

D. index=main source=mySource oldField=* | "'newField('makeMyField(oldField)')'" | table _time newField
❌ This is invalid syntax. The macro is nested inside extra quotes and parentheses in a way that Splunk cannot parse. The pipe | expects a command, but this does not resolve to a valid command or expression.

References

Splunk Documentation:
"Macros are enclosed in backticks and can be used in searches, eval expressions, and as commands."
Question 64 Choose 1
What is the correct Boolean order of evaluation for the where command from first to last?
Show answerHide answer

Correct answer: C Parentheses, NOT, AND, OR

Explanation

Explanation:

The where command in Splunk evaluates Boolean expressions based on a defined operator precedence. The order from highest to lowest precedence is:

Parentheses ( ) – Highest precedence. Expressions inside parentheses are evaluated first, allowing you to override default precedence.
NOT – Logical negation is applied next.
AND – Logical conjunction is evaluated before OR.
OR – Lowest precedence; evaluated last.

This is the standard precedence used in most programming languages and query languages, and Splunk's where command follows this exact order.

❌ Why the other options are incorrect

A. NOT, Parentheses, OR, AND
– Incorrect because parentheses have the highest precedence, not NOT. Evaluating NOT before parentheses would yield incorrect results in complex expressions. For example, NOT (A OR B) would be misinterpreted.

B. AND, Parentheses, NOT, OR
– Incorrect because parentheses and NOT must come before AND. AND does not have the highest precedence. This order would cause AND to be evaluated before grouping or negation, breaking logical flow.

D. Parentheses, NOT, OR, AND
– Incorrect because AND has higher precedence than OR. This order places OR before AND, which would lead to incorrect evaluation. For instance, A AND B OR C would be evaluated as A AND (B OR C) instead of (A AND B) OR C.

📚 References

Splunk Documentation:
"The where command evaluates Boolean expressions in the following order: parentheses, NOT, AND, OR."
Question 65 Choose 3
Which of the following commands are used when creating visualizations (select all that apply.)
Show answerHide answer

Correct answer: A, C, D GeomGeostatsiplocation

Explanation

📘 Explanation:

Splunk provides several commands that are directly used when creating visualizations, especially geographic and statistical ones. Among the listed options, the correct commands are geom, geostats, and iplocation.

A.Geom → This command is essential for choropleth maps. It overlays geographic boundaries (from KMZ/KML files) onto map visualizations. For example, when plotting data by U.S. states or world countries, geom links the search results to the appropriate geographic shapes. Without geom, Splunk cannot render shaded regions on a choropleth map.

C.Geostats → This command aggregates data by geographic coordinates (latitude and longitude). It is commonly used for cluster maps and other geo‑based visualizations. For example, geostats count by ip can display event density across different regions.

D.iplocation → This command enriches events by converting IP addresses into geographic fields such as City, Country, Region, lat, and lon. These fields can then be used in maps or other visualizations. For instance, ... | iplocation clientip | geostats count by Country produces a visualization of traffic by country.

❌ Why Other Options Are Incorrect

B. Choropleth → Not a command. Choropleth is a visualization type, not an SPL command. To build a choropleth map, you use geom along with geographic data, but there is no choropleth command in Splunk.

References:

Splunk Docs – Geom command
Splunk Docs – Geostats command
Splunk Docs – iplocation command
Question 66 Choose 1
How many ways are there to access the Field Extractor Utility?
Show answerHide answer

Correct answer: A 3

Explanation

Explanation:

Splunk provides three distinct ways to access the Field Extractor directly from the search results interface:

Bottom of the fields sidebar – Click Extract New Fields at the bottom of the fields sidebar panel . This method starts the Field Extractor at the Select Sample step.

All Fields dialog box – Click Extract new fields at the top of the All Fields dialog box, which you can access from the fields sidebar .

Any event in the search results – Open an individual event, click Event Actions (the dropdown menu on the event), and select Extract Fields . This method bypasses the Select Sample step and starts you directly at the Select Method step because the sample event is already chosen .

These three methods are specifically for accessing the Field Extractor from the search window context .

❌ Why the other options are incorrect

B. 4– There are only three post-search entry points, not four. The documentation explicitly lists "three post-search entry points to the field extractor" . The number four might be confused with additional access methods outside the search window.

C. 1 – There is clearly more than one way to access the Field Extractor. Users can access it through the fields sidebar, the All Fields dialog box, or directly from an event's actions menu .

D. 5 – This number is not supported by the documentation. While there are additional ways to access the Field Extractor from Settings > Field Extractions or when adding data with a fixed sourcetype , these are not search-window entry points. For this specific question context, the answer remains three.

📚 References

Splunk Knowledge Manager Manual: "All users can access the field extractor after running a search that returns events. You have three post-search entry points to the field extractor: Bottom of the fields sidebar, All Fields dialog box, Any event in the search results" .
Question 67 Choose 1
Which of the following is a feature of the Pivot tool?
Show answerHide answer

Correct answer: C Creates reports without using SPL

Explanation

Explanation

The Pivot tool in Splunk is a visual, drag-and-drop interface that enables users to create reports and dashboards without writing any SPL (Search Processing Language). It is designed for users who may not be familiar with Splunk's search syntax, allowing them to explore and visualize data by simply selecting fields from a data model and dragging them into rows, columns, and metrics.

Pivot works exclusively with data models that have been accelerated by a knowledge manager. Once a data model is accelerated, users can select a dataset and use Pivot's interface to build tables, charts, and other visualizations without ever typing a search command. Pivot is a powerful feature for self-service analytics, enabling business users to generate reports quickly.

❌ Why the other options are incorrect

A. Creates lookups without using SPL
– Pivot is not used for creating lookups. Lookups are created through the Lookup Editor or by manually uploading CSV files and defining them in transforms.conf. Pivot has no functionality for creating or managing lookup tables.

B. Data Models are not required – This is incorrect because Pivot requires a data model to function. Pivot is specifically built on top of data models; without an accelerated data model, the Pivot interface will not load any data. Users must select a data model and a dataset before they can begin building reports.

D. Datasets are not required – This is also incorrect. Pivot requires a dataset (an object within a data model) to create a report. Datasets define the constraints and fields available for analysis. Without selecting a dataset, Pivot has no data to pivot on.

📚 References

Splunk Documentation – Pivot:
"Pivot is a visual tool that enables you to create reports without using the Splunk search language."

Splunk Documentation – Pivot Requirements:
"Pivot requires that a data model is accelerated and that you have access to it."
Question 68 Choose 1
Which command can include both an over and a by clause to divide results into subgroupings?
Show answerHide answer

Correct answer: A chart

Explanation

Explanation:

The chart command is the only transforming command that supports both an over clause and a by clause to create subgroupings. The over clause defines the primary grouping (typically a field like _time or host), while the by clause splits each primary group into secondary subgroups. This produces a pivot‑table style output where rows represent the over field values and columns represent the by field values.

❌ Why the other options are incorrect

B. stats
– The stats command supports a by clause for grouping but does not support an over clause. It cannot produce a matrix‑style output with both rows and columns. Use stats when you want a flat table of grouped results, not a pivot.

C. xyseries
– This command transforms data into a table using x (row), y (column), and z (value) fields. It does not use over or by keywords. While it can achieve similar output, the syntax is different and it is not the command that includes both clauses.

D. transaction
– This command groups events based on common fields and time constraints. It does not support over or by at all. It is used for event correlation, not for statistical subgrouping.

📚 References

Splunk Documentation – chart command:
"The chart command can include an over clause and a by clause. The over clause splits the results into columns of data for each distinct value of the over field."
Question 69 Choose 1
What is the correct syntax to find events associated with a tag?
Show answerHide answer

Correct answer: D tag=

Explanation

Explanation:

The correct syntax to search for events associated with a tag in Splunk is tag=. Tags are knowledge objects applied to specific field‑value pairs (e.g., host=webserver01 with tag production). Searching tag=production returns all events that have the tag production attached to any field‑value combination. This is the standard, documented way to retrieve tagged events.

❌ Why the other options are incorrect

A. tag:= – The colon plus equals (:=) is not a valid operator for tag searches. In Splunk, := is used in certain assignment contexts (e.g., within eval for variable assignment), but it is not recognized as a comparison or tag‑search operator. Using tag:=production would result in a syntax error or return no results.

B. tags=– The field name is singular tag, not plural tags. Splunk does not have a default field named tags. Searching tags=production would look for a field called tags, which does not exist, and therefore would not return any events tagged with production. Tags are stored under the tag field at search time.

C. tags:= – This combines two errors: an invalid plural field name (tags) and an invalid operator (:=). It is doubly incorrect and would not produce any results.

References

Splunk Documentation – Tags:
"To search for events that have a specific tag, use tag=."
Question 70 Choose 1
A field alias is created where field1—fieid2 and the Overwrite Field Values checkbox is selected. What happens if an event only contains values for fieid1?
Show answerHide answer

Correct answer: D field2 values are replaced with the value of the field1.

Explanation

Explanation:

When you create a field alias field1 → field2 with the Overwrite Field Values checkbox selected, the alias behaves as follows: if an event contains the source field (field1), the target field (field2) is replaced with the value of field1. If the event contains field1 but does not contain field2, then field2 is added with the value of field1. If the event contains only field2 (and no field1), then field2 is removed from the event.

In your specific scenario, the event contains only field1, so field2 is created and populated with the value of field1.

❌ Why the other options are incorrect

A. field2 values are removed from the events. – This would only happen if the event contained only the alias field (field2) and not the source field (field1). Since the event contains field1, field2 is either added or replaced, not removed.

B. field1 and field2 values are merged. – There is no merging of values. Field aliases perform a one‑way mapping: field1's value is used to set field2's value. They do not combine or concatenate values.

C. field2 values are unchanged. – This would only occur if the Overwrite Field Values checkbox were not selected. When unchecked, field2 retains its original value even if field1 exists. Since the checkbox is selected in this question, field2 is overwritten, not left unchanged.

References

Splunk Documentation – Field Aliases:
"When Overwrite field values is selected, the alias field is replaced with the value of the source field when the source field exists. If the source field does not exist, the alias field is removed."
Full mock exam

Sit the SPLK-1002 exam before exam day

Full-length mocks with the same number of questions and the same time limit as the real SPLK-1002 exam. Every attempt draws a new set of questions from the full bank, so you can keep going until you pass comfortably.

Get full SPLK-1002 mock exam
  • 65questions per mock
  • 105 mintime limit
  • 306questions in the bank
  • Newmock on every attempt