Fundamentals 3 Flashcards
What command enables you to calculate stats on data that matches your search criteria?
stats command
What does the | fieldsummary command do?
Calculates summary stats for all/subset of fields and displays in table form:
| fieldsummary [maxvals=num] [field-list]
- maxval: max distinct vals to return for the values stat of each field
- field-list: fields to calc stats for
What does the is_exact boolean indicate in the |fieldsummary results?
is_exact represents whether the distinct_count is exact
What does the |appendpipe command do?
- Takes existing results and pushes them into sub pipeline
- Appends sub pipeline results as new lines to the outer search
How do you name the appendpipe subtotals field after appending?
Use |eval column_name= “subtotals name”
How do you create a grandtotal field when using the |appendpipe command?
Use another |appendpipe command to search for and total only the subtotals fields
How do you use count and list functions to remove duplicates for info in tabular form?
- Use |stats count as normal
- Use |stats list(columnBfield), list(columnCfield) … by columnAfield
- Column A is no longer duplicated
What does the |eventstats command do?
Generates summary stats of all existing fields in search results and saves as new fields
- Works on entire results
What does |streamstats do
Generates stats on fields and compiles to previous data
- Works on entire results but calculates stats for each result row at the time command encounters it
- index order matters
What are two arguments that can be used with |streamstats
- current= t or f :include or not include current event in summary calc
- window=# : calc over past # of events
What does the |eval command do
Manipulate and calculate expression and creates a new field or overwrites existing one
|eval fieldname1=expression1, fieldname2=expression2
What are the |eval command conversion functions
tostring
tonumber
printf
What are the options for and syntax of the tostring function
tostring(field, “option”)
Options being: commas(also rounding to 2 decimals), duration(hh:mm:ss), hex
What are the options for and syntax of the tonumber function
tonumber(numstr,base)
Where numstr can be a field name or a number and base is optional
What are the options for and syntax of the printf function
printf(“format”,arguments)
Where format is conversion specifiers(%d,%f%s…) and arguments are optional
What does the eval now() function return
Time a search was started
What does the eval time() function return
Time event was processed by the eval command
What does the eval strftime function do
Converts timestamp to string format using strftime(X,Y) to convert epoch time to a readable format. Where x is UNIX time in seconds to be converted to a string
EX: Y= “%B-%d-%Y” yields format example February-19-2018
What does the eval strptime function do
Converts time in string format and parses it into a timestamp using strptime(x,y) where x is a time in string format and y is a timestamp format defined by variables
What does the eval relative_time function return
Returns timestamp relative to a supplied time as if asking for data a day prior to a certain event
What do the lower() and upper() functions of the eval command return
Conversion of string to lower or upper case
What does the eval substr(X,Y,Z) command return
Returns substring of X, according to the starting index Y and the length of Z
What does the eval replace(X,Y,Z) command do
Where X,Y,Z are all strings and Y is a regex, return a string where Z replaces each occurrence of Y in X
Note: eval commands do not alter the indexed data or write new data to index
Do non-numeric values need to be in quotations when using the if() function?
yes