User Agent Raw Mapping

You need to modify the index template used so that the fields in question are not_analyzed.

Alternatively, you can aggregate on the .raw subfield that you probably have.