Mutate add_field value null

Hi,

Is possible to add a field with value null, for example something like this:
Mutate{ add_field{"field1"=> null}}

I tried this, but added null like a string

Thanks!!

I suspect you need to use a ruby filter.

ruby { code => "event['nullfield'] = nil" }

Hi,

I tried using this in my code as mentioned below:

mutate{ rename=>{"add_user_name" => "userName"}}
if[userName] {
add_field=>{"assignedBy"=> "%{userName}"}}
add_field=>{"createdBy"=> "%{userName}"} }
}
else{
ruby { code => "event['assignedBy'] = nil" }
ruby { code => "event['createdBy'] = nil" }
}

But the data load from database is failing after this addition. (Only 3 rows are loaded out of some 70k rows). Kindly suggest. What am I missing here?

@sheilj, please start a new thread for your unrelated question.