I can repro the issue when there is no "()" for the metrics names.
I assume that you mentioned not working URL is not corresponding your error info. As you mentioned 2 URL just resource group and virtual machine name are not the same exclude start time and end time. Please have a try to use the following URL to test it again. it works correctly on my side.
https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourcegroup}/providers/Microsoft.Compute/virtualMachines/{machineName}/providers/microsoft.insights/metrics?$filter=(%20name.value%20eq%20'Disk%20Write%20Operations/Sec'%20or%20%20name.value%20eq%20'Percentage%20CPU'%20or%20%20name.value%20eq%20'Network%20In'%20or%20%20name.value%20eq%20'Network%20Out'%20or%20%20name.value%20eq%20'Disk%20Read%20Operations/Sec'%20or%20%20name.value%20eq%20'Disk%20Read%20Bytes'%20or%20%20name.value%20eq%20'Disk%20Write%20Bytes'%20%20)%20and%20timeGrain%20eq%20duration'PT5M'%20and%20startTime%20eq%202017-10-26T05:28:34.919Z%20and%20endTime%20eq%202017-10-26T05:33:34.919&api-version=2016-09-01
If use C# SDK is acceptable, we could use Microsoft.Azure.Management.Monitor.Fluent to that, following is my demo code, it works correctly on my side.
var azureTenantId = "tenant id";
var azureSecretKey = "secret key";
var azureAppId = "client id";
var subscriptionId = "subscription id";
var resourceGroup = "resource group";
var machineName = "machine name";
var serviceCreds = ApplicationTokenProvider.LoginSilentAsync(azureTenantId, azureAppId, azureSecretKey).Result;
MonitorClient monitorClient = new MonitorClient(serviceCreds) { SubscriptionId = subscriptionId };
var resourceUrl = $"subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/virtualMachines/{machineName}";
var metricNames = "(name.value eq 'Disk Write Operations/Sec' or name.value eq 'Percentage CPU' or name.value eq 'Network In' or name.value eq 'Network Out' or name.value eq 'Disk Read Operations/Sec' or name.value eq 'Disk Read Bytes' or name.value eq 'Disk Write Bytes')";
string timeGrain = " and timeGrain eq duration'PT5M'";
string startDate = " and startTime eq 2017-10-26T05:28:34.919Z";
string endDate = " and endTime eq 2017-10-26T05:33:34.919Z";
var odataFilterMetrics = new ODataQuery<MetricInner>(
$"{metricNames}{timeGrain}{startDate}{endDate}");
var metrics = monitorClient.Metrics.ListWithHttpMessagesAsync(resourceUrl, odataFilterMetrics).Result;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…