Perform Upload

post

/serviceapi/logan.uploads

Queues a file for immediate indexing a file. The file is consumed only once. It does monitor it continuously. This endpoint can handle any single file: plain, compressed or archive. The file is indexed in full, regardless of whether or not it is already indexed.

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

Supported Media Types
Query Parameters
  • Indicates that only time and a message should be parsed from the logs. (aka the generic parser)
  • Name of the entity to associate the logs with.
  • Entity type of the entity.
  • Name of the log parser to use for this upload. It is recommended that end user upload commands no longer specify this parameter.
  • Name of the log source to use for this upload
  • 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.
  • 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.
Back to Top

Response

Supported Media Types

200 Response

Operation succeeded.

400 Response

Bad request. See response body for explanation.
Body ()
Root Schema : InternalErrorResponse
Type: object
Show Source
Nested Schema : messages
Type: array
Show Source
Nested Schema : violations
Type: array
Show Source
Nested Schema : ParserViolation
Type: object
Show Source

403 Response

Forbidden. User does not have required privileges.

500 Response

Internal server error. See response body for explanation.
Body ()
Root Schema : InternalErrorResponse
Type: object
Show Source
Nested Schema : messages
Type: array
Show Source
Nested Schema : violations
Type: array
Show Source
Nested Schema : ParserViolation
Type: object
Show Source
Back to Top

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",
 }
Back to Top