Skip to main content

sources

Creates, updates, deletes, gets or lists a sources resource.

Overview

Namesources
TypeResource
Idsumologic.collectors.sources

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idintegerSource identifer.
namestringSource name.
alivebooleanSource alive.
automaticDateParsingbooleanSource automaticDateParsing.
categorystringSource category.
cutoffTimestampintegerSource cutoffTimestamp.
denylistarraySource denylist.
encodingstringSource encoding.
fieldsobjectSource fields.
filtersarraySource filters.
forceTimeZonebooleanSource forceTimeZone.
hashAlgorithmstringSource hashAlgorithm.
hostNamestringSource hostName.
messagePerRequestbooleanSource messagePerRequest.
multilineProcessingEnabledbooleanSource multilineProcessingEnabled.
pathExpressionstringSource pathExpression.
sourceTypestringSource sourceType.
urlstringSource url.
useAutolineMatchingbooleanSource useAutolineMatching.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_source_by_idselectcollectorId, sourceId, regionGets information about a specified Collector and Source.
list_sourcesselectcollectorId, regionGets information about all Sources for a specified Collector.
create_sourceinsertcollectorId, regionCreates a new Source for a Collector. See Use JSON to Configure Sources for required fields for the request JSON file.
delete_sourcedeletecollectorId, sourceId, regionDelete Source by ID
update_sourceexeccollectorId, sourceId, regionUpdate a source

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
collectorIdstringUnique Collector identifier.
regionstringSumoLogic region (enum: [us2, au, ca, de, eu, fed, in, jp], default: us2)
sourceIdstringUnique Source identifier.

SELECT examples

Gets information about a specified Collector and Source.

SELECT
id,
name,
alive,
automaticDateParsing,
category,
cutoffTimestamp,
denylist,
encoding,
fields,
filters,
forceTimeZone,
hashAlgorithm,
hostName,
messagePerRequest,
multilineProcessingEnabled,
pathExpression,
sourceType,
url,
useAutolineMatching
FROM sumologic.collectors.sources
WHERE collectorId = '{{ collectorId }}' -- required
AND sourceId = '{{ sourceId }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a new Source for a Collector. See Use JSON to Configure Sources for required fields for the request JSON file.

INSERT INTO sumologic.collectors.sources (
data__source,
collectorId,
region
)
SELECT
'{{ source }}',
'{{ collectorId }}',
'{{ region }}'
RETURNING
id,
name,
alive,
automaticDateParsing,
category,
cutoffTimestamp,
denylist,
encoding,
fields,
filters,
forceTimeZone,
hashAlgorithm,
hostName,
messagePerRequest,
multilineProcessingEnabled,
pathExpression,
sourceType,
url,
useAutolineMatching
;

DELETE examples

Delete Source by ID

DELETE FROM sumologic.collectors.sources
WHERE collectorId = '{{ collectorId }}' --required
AND sourceId = '{{ sourceId }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Update a source

EXEC sumologic.collectors.sources.update_source 
@collectorId='{{ collectorId }}' --required,
@sourceId='{{ sourceId }}' --required,
@region='{{ region }}' --required
@@json=
'{
"id": {{ id }},
"name": "{{ name }}",
"category": "{{ category }}",
"hostName": "{{ hostName }}",
"automaticDateParsing": {{ automaticDateParsing }},
"multilineProcessingEnabled": {{ multilineProcessingEnabled }},
"useAutolineMatching": {{ useAutolineMatching }},
"alive": {{ alive }},
"forceTimeZone": {{ forceTimeZone }},
"messagePerRequest": {{ messagePerRequest }},
"sourceType": "{{ sourceType }}",
"encoding": "{{ encoding }}",
"hashAlgorithm": "{{ hashAlgorithm }}",
"url": "{{ url }}",
"pathExpression": "{{ pathExpression }}",
"denylist": "{{ denylist }}",
"filters": "{{ filters }}",
"fields": "{{ fields }}",
"cutoffTimestamp": {{ cutoffTimestamp }}
}'
;