Add a field

hi,
i am getting logs from the server and in logstash i would like to add a field and value for it how can i do this

For example like this:

filter {
  mutate {
    add_field => {
      "fieldname" => "fieldvalue"
    }
  }
}

thanks