Splunk 7.x Quick Start Guide (2024)

The eval command calculates an expression and puts the resulting value into a field; this can be used to create a new field, or to replace the value in an existing field. You can use arithmetic operators (+,-,*,/,%), string concatenations (eval name = last.",".first), and Boolean operations (AND, OR, NOT, XOR, <, >, <=, >=, !=, =, ==, and LIKE).

The syntax is | eval <new_field_name> = function(arguments).

Some of the most useful examples include:

FunctionDescriptionExamples
if(X,Y,Z)If X is TRUE, the result is Y; otherwise Z| eval status = if(code==200,"OK","Error")
len(X)Returns the character length of X| eval bytes=len(_raw)
like(X,"Y")Returns TRUE if X is like the SQLite pattern in Y| eval match = like(field, "addr%") ...
Splunk 7.x Quick Start Guide (2024)
Top Articles
Latest Posts
Article information

Author: Dan Stracke

Last Updated:

Views: 6272

Rating: 4.2 / 5 (63 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Dan Stracke

Birthday: 1992-08-25

Address: 2253 Brown Springs, East Alla, OH 38634-0309

Phone: +398735162064

Job: Investor Government Associate

Hobby: Shopping, LARPing, Scrapbooking, Surfing, Slacklining, Dance, Glassblowing

Introduction: My name is Dan Stracke, I am a homely, gleaming, glamorous, inquisitive, homely, gorgeous, light person who loves writing and wants to share my knowledge and understanding with you.