Courseiva

CCNA Transforming Commands And Formatting Questions

31 questions · Transforming Commands And Formatting · All types, answers revealed

1
MCQeasy

Which command is used to display specific fields in the output?

A.display
B.select
C.fields
D.show
AnswerC

The fields command specifies which fields to keep or drop.

Why this answer

The 'fields' command is used to include or exclude fields from the results.

2
MCQmedium

You want to filter out events where the 'action' field is empty. Which command is best?

A.filter action != null
B.where isnotnull(action) AND action!=""
C.search action=*
D.eval action = if(isnull(action), "remove", action) | search action!="remove"
AnswerB

This explicitly checks for null and empty string values.

Why this answer

The 'where' command allows for complex logical filtering.

3
Multi-Selectmedium

Which TWO are true about the 'eval' command?

Select 2 answers
A.It does not create new fields.
B.It can be used to perform logical evaluations.
C.It is a generating command.
D.It is used to filter events.
E.It can be used to perform math operations.
AnswersB, E

Eval handles if/case logic.

Why this answer

It handles math and case sensitivity.

4
MCQmedium

Which command would you use to rename a field to a more readable name in the middle of a search pipeline?

A.fieldformat old_name = new_name
B.rename old_name as new_name
C.alias old_name = new_name
D.eval new_name = old_name
AnswerB

This is the correct syntax for renaming fields.

Why this answer

The 'rename' command is the standard way to alias field names.

5
Multi-Selectmedium

Which TWO of the following are true about 'eventstats'?

Select 2 answers
A.It is faster than stats.
B.It removes non-aggregated fields.
C.It calculates aggregates for each event.
D.It adds aggregate fields to all events.
E.It replaces the existing events.
AnswersC, D

This is the primary function of eventstats.

Why this answer

Eventstats adds results to existing events rather than replacing them.

6
MCQmedium

You need to combine two fields into one string. Which eval function is used?

A.eval new = field1 + field2
B.eval new = field1 . field2
C.eval new = merge(field1, field2)
D.eval new = combine(field1, field2)
AnswerB

The period character performs string concatenation in eval.

Why this answer

The '.' operator or the 'concat' function (in some contexts) or simply concatenating works.

7
Multi-Selectmedium

Which TWO are common causes for a 'transaction' command taking too long?

Select 2 answers
A.The user is not an admin.
B.The number of unique group values is high.
C.The search spans too large a time range.
D.The data is in JSON format.
E.The search uses too few commands.
AnswersB, C

High cardinality slows down transaction grouping.

Why this answer

Large datasets and long time spans cause performance issues.

8
MCQmedium

You want to round a number in a field to two decimal places. Which function is used?

A.eval new_field = round(old_field, 2)
B.format new_field = 2
C.eval new_field = floor(old_field, 2)
D.eval new_field = ceil(old_field, 2)
AnswerA

Round() is the correct function.

Why this answer

The 'round' function takes the field and the number of decimal places.

9
MCQmedium

How do you extract a portion of a string using 'eval'?

A.eval new = cut(old, 1, 5)
B.eval new = slice(old, 1, 5)
C.eval new = substr(old, 1, 5)
D.eval new = extract(old, 1, 5)
AnswerC

Substr is the correct function.

Why this answer

The 'substr' function extracts a substring based on start and length indices.

10
MCQhard

When using 'stats', how does the 'values()' function differ from 'list()'?

A.Values() returns unique values, list() returns all values.
B.List() sorts the data automatically.
C.Values() is faster than list().
D.Values() is only for numbers.
AnswerA

This is the primary functional difference.

Why this answer

Values() returns unique entries, while list() returns every entry found.

11
MCQeasy

Which command sorts results by a field in descending order?

A.sort desc(field)
B.sort field=desc
C.sort field
D.sort -field
AnswerD

The minus sign denotes descending order.

Why this answer

The 'sort -field' syntax sorts in reverse (descending) order.

12
MCQmedium

Which 'eval' function is used to handle conditional logic?

A.if-then-else
B.switch()
C.choose()
D.case()
AnswerD

Case evaluates multiple conditions and returns the value of the first one that is true.

Why this answer

The 'case' function is specifically designed for multiple conditional tests.

13
Multi-Selecthard

Which THREE of the following are valid ways to filter data in Splunk?

Select 3 answers
A.fields -
B.eval
C.rename
D.where
E.search
AnswersA, D, E

The fields command can filter out unwanted fields.

Why this answer

Search, where, and fields (with -) are all used to filter.

14
MCQhard

You are correlating two searches. What is the primary advantage of using 'join' over 'lookup'?

A.Lookups cannot be used with stats.
B.Joins are faster than lookups.
C.Joins are automatically cached.
D.Joins allow for subsearch results to be mapped to the primary search results dynamically.
AnswerD

Joins allow joining a results set from a subsearch to the primary search.

Why this answer

Joins are performed at search time and allow for dynamic subsearch results, whereas lookups are usually static files.

15
MCQmedium

What is the result of 'transaction' command compared to 'stats'?

A.Transaction is for reporting only.
B.Transaction is always faster than stats.
C.Transaction groups events by time and common fields.
D.Stats can only be used with time.
AnswerC

Transaction is designed to link events into a single transaction object.

Why this answer

Transaction groups events into a single entity based on shared fields and time constraints.

16
MCQeasy

Which command is used to remove a field from the search results?

A.eval field_name = null
B.fields - field_name
C.drop field_name
D.delete field_name
AnswerB

The minus sign explicitly excludes the field.

Why this answer

The 'fields -' command removes specified fields.

17
Multi-Selecthard

Which THREE features are available when using the 'lookup' command?

Select 3 answers
A.Performing left joins
B.Outputting data to a CSV
C.Using wildcards for matching
D.Setting cluster master status
E.Replacing existing indexes
AnswersA, B, C

Standard lookup behavior is a left join.

Why this answer

Lookups can be used as outputs, inputs, and with wildcards.

18
MCQhard

How do you handle case-insensitive filtering in a 'where' clause?

A.where field == /value/i
B.where lower(field) = "value"
C.where field = '(?i)value'
D.where field.case = "ignore"
AnswerB

Normalizing both sides is the standard way to ensure case-insensitivity.

Why this answer

The 'lower()' function is used to normalize the string for comparison.

19
Multi-Selecthard

Which THREE of the following functions are used with 'stats' to aggregate data?

Select 3 answers
A.max
B.count
C.eval
D.search
E.sum
AnswersA, B, E

Max is an aggregation.

Why this answer

Sum, count, and max are all valid stats functions.

20
MCQhard

What is the limitation of using 'join' in a search?

A.Joins only work on numerical fields.
B.Joins are deprecated in Splunk.
C.Joins cannot be used with subsearches.
D.The subsearch result limit is 100 by default.
AnswerD

The default maxout limit for subsearches in a join is 100, which can cause data loss.

Why this answer

Joins are memory-intensive and have strict limits on the number of results they can process.

21
MCQeasy

How do you add a total row to a stats table?

A.addsum
B.eval total = sum(field)
C.addtotals
D.stats total
AnswerC

Addtotals is the correct command to sum values.

Why this answer

The 'addcoltotals' command adds a row containing the sum of all numerical columns.

22
Multi-Selecthard

Which THREE of the following are valid aggregation functions used with 'stats'?

Select 3 answers
A.dc
B.where
C.avg
D.count
E.rename
AnswersA, C, D

Dc (distinct count) is a valid function.

Why this answer

Count, avg, and dc are standard aggregation functions.

23
MCQeasy

How do you calculate the percentage of total events for each status code?

A.stats count by status | eventstats sum(count) as total | eval percent = (count/total)*100
B.stats count(status) as total
C.stats count by status | eval percent = count/total
D.chart count by status | addtotals
AnswerA

This uses eventstats to calculate the total across all rows for the percentage calculation.

Why this answer

The 'addcoltotals' or 'eventcount' can be used, but 'stats' with 'perc' or manual calculation is standard.

24
MCQhard

What is the purpose of 'streamstats' compared to 'stats'?

A.It computes aggregates for each event based on current and previous events.
B.It can only be used with time-series data.
C.It is faster for large datasets.
D.It computes aggregates over the entire search result set.
AnswerA

Streamstats maintains a running calculation.

Why this answer

Streamstats calculates statistics as events flow through the pipeline, rather than waiting for all results.

25
MCQeasy

You want to see a list of unique 'clientip' addresses. Which command is most efficient?

A.stats count by clientip
B.head 100
C.dedup clientip
D.chart clientip
AnswerC

Dedup returns the first instance of each unique value.

Why this answer

The 'dedup' command is designed to show unique occurrences of a field.

26
MCQhard

What is the difference between 'chart' and 'timechart'?

A.Timechart automatically buckets by time.
B.They are identical commands.
C.Chart is for time-based data.
D.Timechart is for non-time fields.
AnswerA

Timechart manages time binning automatically.

Why this answer

Timechart forces the x-axis to be time-based, while chart allows any field on the x-axis.

27
Multi-Selecteasy

Which THREE of the following are valid formatting commands?

Select 3 answers
A.rename
B.sort
C.index
D.bucket
E.fieldformat
AnswersA, B, E

Rename is for readability.

Why this answer

Fieldformat, rename, and sort are all formatting.

28
Multi-Selectmedium

Which TWO of the following commands are considered 'transforming' commands?

Select 2 answers
A.timechart
B.stats
C.rex
D.fields
E.where
AnswersA, B

Timechart is a transforming command.

Why this answer

Transforming commands change data into a table format (like stats/chart).

29
Multi-Selectmedium

Which TWO actions can be performed by the 'eval' command?

Select 2 answers
A.Creating new data inputs
B.Concatenating strings
C.Performing mathematical calculations
D.Changing user permissions
E.Removing events from the index
AnswersB, C

Eval performs string concatenation.

Why this answer

Eval allows for math operations and string manipulation.

30
MCQhard

When using 'chart', what is the behavior if you do not specify a 'by' clause?

A.It returns an error.
B.It creates a single-series chart for the entire result set.
C.It defaults to the first field found.
D.It returns the same as 'stats'.
AnswerB

Without a 'by' clause, it aggregates the entire result set into one value.

Why this answer

If no 'by' clause is provided, 'chart' returns a single series based on the aggregation function.

31
MCQeasy

You need to count the total number of unique users per department using the 'stats' command. Which command syntax is correct?

A.stats list(user) by department
B.stats values(user) by department
C.stats dc(user) by department
D.stats count(user) by department
AnswerC

The dc() function correctly identifies distinct counts.

Why this answer

The 'dc' function (distinct count) is used to count unique values in a field.

Ready to test yourself?

Try a timed practice session using only Transforming Commands And Formatting questions.