<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SQS Based Input from S3: Assign different sourcetype based on filename in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/SQS-Based-Input-from-S3-Assign-different-sourcetype-based-on/m-p/540534#M90504</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a Heavy Forwarder on which I receive logs via Splunk for AWS addon as they appear in my S3 bucket.&lt;/P&gt;&lt;P&gt;I know I will be receiving log files ending with `*_connectionlog_*.gz`, `*_userlog_*.gz` and `*_useractivitylog_*.gz`.&lt;/P&gt;&lt;P&gt;My current input definition looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[aws_sqs_based_s3://MyApp_RedshiftAuditLogs]
aws_account = redacted
index = myapp_redshiftindex
interval = 300
s3_file_decoder = CustomLogs
sourcetype = aws:cloudtrail
sqs_batch_size = 10
sqs_queue_region = redacted
sqs_queue_url = https://redacted.url
disabled = 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that there is a `sourcetype` field, that has single value here. I would like to assign this value based on whether there is useractivitylog, connectivitylog or userlog in the filename that just came in on the heavyforwarder.&lt;/P&gt;&lt;P&gt;The vision here is that I will further research how to properly parse and extract each of these types of logs, so when I will be eventually searching the index, I will have extracted some (if not all) of the fields - but I am not at this stage yet.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Am I approaching this correctly by wanting to assign different source types to files that are structured differently?&lt;/P&gt;&lt;P&gt;2. How do I do this assigning thing?&lt;/P&gt;&lt;P&gt;3. Will the path that you propose enable me to write some parsing/extraction logic later down the road?&lt;/P&gt;&lt;P&gt;Thank you for your time!&lt;/P&gt;</description>
    <pubDate>Fri, 19 Feb 2021 13:58:07 GMT</pubDate>
    <dc:creator>LegalPrime</dc:creator>
    <dc:date>2021-02-19T13:58:07Z</dc:date>
    <item>
      <title>SQS Based Input from S3: Assign different sourcetype based on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SQS-Based-Input-from-S3-Assign-different-sourcetype-based-on/m-p/540534#M90504</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a Heavy Forwarder on which I receive logs via Splunk for AWS addon as they appear in my S3 bucket.&lt;/P&gt;&lt;P&gt;I know I will be receiving log files ending with `*_connectionlog_*.gz`, `*_userlog_*.gz` and `*_useractivitylog_*.gz`.&lt;/P&gt;&lt;P&gt;My current input definition looks like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[aws_sqs_based_s3://MyApp_RedshiftAuditLogs]
aws_account = redacted
index = myapp_redshiftindex
interval = 300
s3_file_decoder = CustomLogs
sourcetype = aws:cloudtrail
sqs_batch_size = 10
sqs_queue_region = redacted
sqs_queue_url = https://redacted.url
disabled = 0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that there is a `sourcetype` field, that has single value here. I would like to assign this value based on whether there is useractivitylog, connectivitylog or userlog in the filename that just came in on the heavyforwarder.&lt;/P&gt;&lt;P&gt;The vision here is that I will further research how to properly parse and extract each of these types of logs, so when I will be eventually searching the index, I will have extracted some (if not all) of the fields - but I am not at this stage yet.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Questions:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;1. Am I approaching this correctly by wanting to assign different source types to files that are structured differently?&lt;/P&gt;&lt;P&gt;2. How do I do this assigning thing?&lt;/P&gt;&lt;P&gt;3. Will the path that you propose enable me to write some parsing/extraction logic later down the road?&lt;/P&gt;&lt;P&gt;Thank you for your time!&lt;/P&gt;</description>
      <pubDate>Fri, 19 Feb 2021 13:58:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SQS-Based-Input-from-S3-Assign-different-sourcetype-based-on/m-p/540534#M90504</guid>
      <dc:creator>LegalPrime</dc:creator>
      <dc:date>2021-02-19T13:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: SQS Based Input from S3: Assign different sourcetype based on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SQS-Based-Input-from-S3-Assign-different-sourcetype-based-on/m-p/578676#M102166</link>
      <description>&lt;P&gt;Try:&lt;BR /&gt;s3_file_decoder = CloudTrail&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 21:07:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SQS-Based-Input-from-S3-Assign-different-sourcetype-based-on/m-p/578676#M102166</guid>
      <dc:creator>anwarmmian</dc:creator>
      <dc:date>2021-12-16T21:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: SQS Based Input from S3: Assign different sourcetype based on filename</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/SQS-Based-Input-from-S3-Assign-different-sourcetype-based-on/m-p/578689#M102169</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229441"&gt;@LegalPrime&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;If you want to ingest custom logs other than the natively supported AWS log types, you must set s3_file_decoder = CustomLogs. This setting lets you ingest custom logs into the Splunk platform instance, but it does not parse the data. To process custom logs into meaningful events, you need to perform additional configurations in props.conf and transforms.conf to parse the collected data to meet your specific requirements.

For more information on these settings, see /README/inputs.conf.spec under your add-on directory.&lt;/LI-CODE&gt;&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/AddOns/released/AWS/SQS-basedS3" target="_blank"&gt;https://docs.splunk.com/Documentation/AddOns/released/AWS/SQS-basedS3&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Dec 2021 23:22:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/SQS-Based-Input-from-S3-Assign-different-sourcetype-based-on/m-p/578689#M102169</guid>
      <dc:creator>venkatasri</dc:creator>
      <dc:date>2021-12-16T23:22:46Z</dc:date>
    </item>
  </channel>
</rss>

