Splunk Cheat Sheet

In Splunk

Splunk is a powerful tool for analyzing and visualizing machine-generated data. It can be used to monitor and troubleshoot IT infrastructure, security events, and business operations. However, mastering Splunk can be a daunting task, especially for beginners. That’s where a Splunk cheat sheet comes in handy.

This Splunk cheat sheet is a quick reference guide that provides a list of commonly used commands, functions, and syntax for searching, filtering, and manipulating data in Splunk. It can help you save time and improve your productivity by reducing the need to memorize complex commands or search for them in the documentation.

This cheat sheet provides a comprehensive list of Splunk commands and functions that can be used to search, analyze, and visualize data in Splunk.

Search Commands

CommandDescription
searchSearches for events that match a specified search string.
whereFilters events based on specified conditions.
evalCreates new fields or modifies existing fields based on specified expressions.
fieldsLimits the fields that are returned in search results.
renameRenames fields in search results.
sortSorts search results based on specified fields.
topReturns the top values for a specified field.
statsCalculates statistics for specified fields.
chartCreates charts and graphs based on search results.
timechartCreates time-based charts and graphs based on search results.
rexExtracts fields from events using regular expressions.
spathExtracts fields from events using JSONPath expressions.
transactionGroups events into transactions based on specified criteria.
joinJoins events from multiple sources based on specified fields.
lookupAdds fields to events based on data in a lookup table.
inputlookupSearches a lookup table and returns the results.
outputlookupWrites search results to a lookup table.
inputcsvReads data from a CSV file and creates events.
outputcsvWrites search results to a CSV file.
inputxmlReads data from an XML file and creates events.
outputxmlWrites search results to an XML file.
inputjsonReads data from a JSON file and creates events.
outputjsonWrites search results to a JSON file.

Search Functions

FunctionDescription
countCounts the number of events that match a specified search string.
sumCalculates the sum of a specified field.
avgCalculates the average of a specified field.
minReturns the minimum value of a specified field.
maxReturns the maximum value of a specified field.
medianCalculates the median of a specified field.
modeCalculates the mode of a specified field.
percentileCalculates the percentile of a specified field.
stddevCalculates the standard deviation of a specified field.
varCalculates the variance of a specified field.
absReturns the absolute value of a specified field.
ceilRounds up a specified field to the nearest integer.
floorRounds down a specified field to the nearest integer.
roundRounds a specified field to the nearest integer.
sqrtCalculates the square root of a specified field.
logCalculates the natural logarithm of a specified field.
expCalculates the exponential value of a specified field.
sinCalculates the sine of a specified field.
cosCalculates the cosine of a specified field.
tanCalculates the tangent of a specified field.
asinCalculates the inverse sine of a specified field.
acosCalculates the inverse cosine of a specified field.
atanCalculates the inverse tangent of a specified field.
strftimeFormats a specified field as a date and time string.
strptimeParses a date and time string and returns a timestamp.
replaceReplaces a specified string with another string in a specified field.
substrReturns a substring of a specified field.
toupperConverts a specified field to uppercase.
tolowerConverts a specified field to lowercase.
trimRemoves leading and trailing whitespace from a specified field.
ltrimRemoves leading whitespace from a specified field.
rtrimRemoves trailing whitespace from a specified field.
splitSplits a specified field into an array based on a specified delimiter.
joinJoins an array of values into a string based on a specified delimiter.
mvindexReturns a specified element from an array in a specified field.
mvcountCounts the number of elements in an array in a specified field.
mvfilterFilters an array in a specified field based on specified conditions.
mvzipCombines two arrays in a specified field into a single array.
mvexpandExpands an array in a specified field into multiple events.

Conclusion

This Splunk cheat sheet provides a comprehensive list of commands and functions that can be used to search, analyze, and visualize data in Splunk. By using these commands and functions, you can quickly and easily extract insights from your data and gain valuable insights into your business operations.

Reference:

https://docs.splunk.com/Documentation