Using REST endpoint to add log data, can i set the MetricName value?

New Contributor

Disclaimer that i am new to OMS.  I am using the endpoint to save log entries to OMS.  I am sending the messages as JSON which automatically creates new columns and filters for me in OMS.  The properties it creates are generally suffixed with "_s" for string or "_g" for guid.  I noticed there is a property already available called "MetricName" but when i try to set a value for it in my log entry, it adds a column called "MetricName_s".  The same message also has the property DurationMs and that gets set fine. 


My question is, how can i set the MetricName property on a log entry when posting to a REST endpoint.


Tank you,


3 Replies
best response confirmed by Stanislav Zhelyazkov (MVP)


When you send particular field/column to Log Analytics its name is changed based on the type. This is true for almost any field/column. However there are some fields/columns which are called reserved that you can send without name change if you send them in the right type of course. I've covered this topic here:


MetricName is not such a field/column.

I'm still a little confused.  Why is it that DurationMs doesn't suffix anything, but MetricName does?  


From my understanding, you can do auto-scaling based on a metricname/value so i was hoping to be able to upload app specific timings in order to support scaling.  Seems silly that i would have to create a custom field for a field already there


I am not sure what you mean by auto-scaling. There are just some fields that are common for all tables and some that are created when uploading data. No matter how a filed is named that should not be a problem to cover any scenario that you have in mind. The query language itself is so powerful that you can even rename and extend the data while querying.