

TABLE: This command helps to format the results into tabular output. Example: | replace fetchReport with Report, viewReport with Report in serviceType.REPLACE: This command helps to replace the values of fields with another value, below command will replace the values "fetchReport" and "viewReport" as "Report" in "serviceType' field. Example: | rename service AS serviceType, RC AS responseCode.RENAME: This command helps to rename field(s), below command will rename a field named as service to serviceType and RC as responseCode

SPLUNK EVAL TIME DIFFERENCE CODE
The output will be something like: viewReport have a response code of 200įIELDS: This command helps to keep or remove specified fields from the search results, below command will keep just three fields in your search result.Let's say you want to create a new filed and concatenate results of multiple fields and bring them to your newly created field, below command will create a new field called "Output" and will have the value of two fields "request" and "RC" in addition to that some normal static text.

of the response code is equals to 200 it will mark it as OK otherwise for all other response code it will mark it as Error. Lets say you want to add a new field, for doing so you can use something like given below, it command will create a new field based on the IF condition i.e. There are multiple different functions available for eval command.
SPLUNK EVAL TIME DIFFERENCE SERIES
TIMECHART: Helps you to create a time series chart with respect to event statistics.

Example: | eval "Average Revenue" = " $" + tostring(avg_revenue, " commas").let's say if the input value is a number, it re-formats and changes it to a string, on the other hand, lets say if the input value is boolean, it returns either "True" or "False". TOSTRING: Helps to convert an input value to a string. Round the value down to the nearest whole integer.Īpart from this, there are other functions as well which are used by eval command, for instance, pi(), sqrt() etc.Example: | eval Average= floor(Average).Give the output with the maximum possible number of decimal values.Example: | eval Average= exact(Average).Round the value up to the next highest integer.
