Perform Upload
/serviceapi/logan.uploads
The following archive file types are supported:
- zip
- tar
- tar.gz
- tgz
- gz
- zip can contain gz and tar. ZIP is the only container of other archive formats
To upload a file that contains heterogeneous logs, simply specify a log source that includes the appropriate set of parsers on the upload command (logSourceName parameter).
If the uploaded logs are to be associated with an entity (target); that is, the entityName and entityType parameters are specfiied, if the entity does not already exist it will automatically be created. If the uploadName parameter is specified and the upload container does not already exist it will automatically be created. Otherwise, if the upload container already exists the logs from this upload command will be appended to the existing upload container.
The cURL command must be URL encoded.
Request
- application/json
-
autoParseTimeOnly(optional): boolean
Indicates that only time and a message should be parsed from the logs. (aka the generic parser)
-
entityName(optional): string
Name of the entity to associate the logs with.
-
entityType(optional): string
Entity type of the entity.
-
logParserName(optional): string
Name of the log parser to use for this upload. It is recommended that end user upload commands no longer specify this parameter.
-
logSourceName: string
Name of the log source to use for this upload
-
timezone(optional): string
Timezone to be used when processing log entries whose timestamps do not include an explicit timezone. By default when not specified, the timezone of the target specified in the command is used. If the target does not have a valid timezone or the target is not specified then UTC is used.
-
uploadName(optional): string
Name of the upload. It is strongly recommended that all end user upload commands specify this parameter. When an uploadName is not specified, an upload container is not created. As a result, it is not possible to use the other APIs for retrieving the details of the upload, including its upload status, or deleting the upload. Support for container-less uploads primarily exist for inter-service use cases.
Response
- application/json
200 Response
400 Response
object
-
messages(optional):
array messages
-
type(optional):
string
Allowed Values:
[ "PARSERERROR", "INVALIDPARAMETER", "UNSUPPORTEDSUBSYSTEM", "UNSUPPORTEDFILTER", "UNSUPPORTEDVERSION", "INVALIDJOBID", "INVALIDQUERYID", "FORBIDDEN", "INTERNALERROR", "JSONERROR", "INTERRUPTEDERROR", "EXECUTIONERROR", "COMPILATIONERROR", "SERVICEAVAILABILITYERROR" ]
-
violations(optional):
array violations
403 Response
500 Response
object
-
messages(optional):
array messages
-
type(optional):
string
Allowed Values:
[ "PARSERERROR", "INVALIDPARAMETER", "UNSUPPORTEDSUBSYSTEM", "UNSUPPORTEDFILTER", "UNSUPPORTEDVERSION", "INVALIDJOBID", "INVALIDQUERYID", "FORBIDDEN", "INTERNALERROR", "JSONERROR", "INTERRUPTEDERROR", "EXECUTIONERROR", "COMPILATIONERROR", "SERVICEAVAILABILITYERROR" ]
-
violations(optional):
array violations
Examples
Run the following command to upload a plain, non-archived file:
curl -u "OMC_USERNAME" -X POST -H "Content-Type:application/json" "https://{OMC_URL}/serviceapi/logan.uploads?uploadName=SyslogUpload&entityName=test.example.com&entityType=Host%20(Linux)&logSourceName=Linux%20Syslog%20Logs" -F 'data=@syslog.log'
Example of Response
The following shows an example of the response body.
{ "uploadId":6346458492036981385, "instanceId":8317041357184904872, "status":"inProgress", "startedBy":"adminuser", "startedOn":"2016-08-30T00:00:00.000Z", "totalChunks":1, "files":[ { "fileName":"syslog.log", "sourceId":9084492413699084083, "targetId":"BACBADB123ANBCBA12389112037", "sourceName":"Linux Syslog Logs", "targetName":"test.example.com", "targetType":"Host (Linux)", "entityName":"test.example.com", "entityType":"Host (Linux)", "entityId":"D462B168ADB9878A703A39BB39098D" } ], "canonicalLink":"v1/logdata/uploads/6346458492036981385/instances/8317041357184904872", }
Example 2: Generic Parser Upload
Run the following command to upload a file using the generic parser:
curl -u "OMC_USERNAME" -X POST -H "Content-Type:application/json" "https://{OMC_URL}/serviceapi/logan.uploads?uploadName=SyslogUpload&entityName=test.example.com&entityType=Host%20(Linux)&logSourceName=Linux%20Syslog%20Logs&autoParseTimeOnly=true" -F 'data=@syslog.log'
Example of Response
The following shows an example of the response body.
{ "uploadId":6346458492036981385, "instanceId":8317041357184904872, "status":"inProgress", "startedBy":"adminuser", "startedOn":"2016-08-30T00:00:00.000Z", "totalChunks":1, "files":[ { "fileName":"syslog.log", "sourceId":9084492413699084083, "targetId":"D462B169AABCBAAC03A39BB39098D", "sourceName":"Linux Syslog Logs", "autoParseTimeOnly" : true, "targetName":"test.example.com", "targetType":"Host (Linux)", "entityName":"test.example.com", "entityType":"Host (Linux)", "entityId":"D462B169A46AABC8654903A39BB39098D" } ], "canonicalLink":"v1/logdata/uploads/6346458492036981385/instances/8317041357184904872", }