< Back

Send-OMSAPIIngestionFile

Sat Jan 18, 2020 5:49 pm

NAME Send-OMSAPIIngestionFile



SYNOPSIS

Sends the json payload securely to a customer workspace leveraging a

customer ID and shared key





SYNTAX

Send-OMSAPIIngestionFile [-customerId] <Object> [-sharedKey] <Object> [-body] <Object> [-logType] <Object>

[[-TimeStampField] <Object>] [[-EnvironmentName] <Object>] [<CommonParameters>]





DESCRIPTION

Leveraging a customer workspaceID and private key for Log Analytics

this function will send a json payload securely to the OMS ingestion

API for indexing





PARAMETERS

-customerId <Object>

The customer workspace ID that can be found within the settings pane of the

OMS workspace.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-sharedKey <Object>

The primary or secondary private key for the customer OMS workspace

found within the same view as the workspace ID within the settings pane



Required? true

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-body <Object>

json payload



Required? true

Position? 3

Default value

Accept pipeline input? false

Accept wildcard characters? false



-logType <Object>

Name of log to be ingested assigned to JSON payload

(will have "_CL" appended upon ingestion)



Required? true

Position? 4

Default value

Accept pipeline input? false

Accept wildcard characters? false



-TimeStampField <Object>

Time data was ingested. If $TimeStampField is defined for JSON field

when calling this function, ingestion time in Log Analytics will be

associated with that field.



example: $Timestampfield = "Timestamp"



foreach($metricValue in $metric.MetricValues)

{

$sx = New-Object PSObject -Property @{

Timestamp = $metricValue.Timestamp.ToString()

MetricName = $metric.Name;

Average = $metricValue.Average;

SubscriptionID = $Conn.SubscriptionID;

ResourceGroup = $db.ResourceGroupName;

ServerName = $SQLServer.Name;

DatabaseName = $db.DatabaseName;

ElasticPoolName = $db.ElasticPoolName

}

$table = $table += $sx

}

Send-OMSAPIIngestionFile -customerId $customerId -sharedKey $sharedKey`

-body $jsonTable -logType $logType -TimeStampField $Timestampfield



Required? false

Position? 5

Default value

Accept pipeline input? false

Accept wildcard characters? false



-EnvironmentName <Object>

If $EnvironmentName is defined for AzureUSGovernment

when calling this function, ingestion will go to an Azure Government Log Analytics

workspace. Otherwise, Azure Commercial endpoint is leveraged by default.



Required? false

Position? 6

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS





RELATED LINKS