<?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 concatenate a field to my source and regex the result in Splunk ITSI</title>
    <link>https://community.splunk.com/t5/Splunk-ITSI/concatenate-a-field-to-my-source-and-regex-the-result/m-p/533859#M2263</link>
    <description>&lt;P&gt;Splunk Noob.&lt;BR /&gt;I have a custom http sourcetype with multiple data sources. For one of these sources (aws:firehose), I need to concatenate a field value (ecs_task_definition) to the source value, then do a regex or an eval at some point to remove the trailing colon and numbers, preferably all at index time. I've been advised the field=ecs_task_definition will contain a few hundred dynamic values that will change from time to time, so I can't assign these statically.&lt;/P&gt;&lt;P&gt;My example:&lt;/P&gt;&lt;P&gt;sourcetype=httpevent&lt;/P&gt;&lt;P&gt;source=aws:billing&lt;BR /&gt;source=aws:s3&lt;BR /&gt;source=aws:inspector&lt;BR /&gt;source=aws:firehose&lt;/P&gt;&lt;P&gt;ecs_task_definition=arc-permission-service-worker:100&lt;BR /&gt;ecs_task_definition=arc-enrollment-service:182&lt;BR /&gt;ecs_task_definition=arc-reporting-service:234&lt;BR /&gt;ecs_task_definition=arc-tenant-service:332&lt;/P&gt;&lt;P&gt;I would like the final result to look like:&lt;/P&gt;&lt;P&gt;source=aws:firehose:arc-tenant-service&lt;BR /&gt;source=aws:firehose:arc-reporting-service&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have been trying to do this in props and transforms without success. I think I'm having both syntax problems added to a general lack of understanding of what I can and can't do at index time verses search time. Any help would be much appreciated. Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 22 Dec 2020 16:11:22 GMT</pubDate>
    <dc:creator>ictrees28</dc:creator>
    <dc:date>2020-12-22T16:11:22Z</dc:date>
    <item>
      <title>concatenate a field to my source and regex the result</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/concatenate-a-field-to-my-source-and-regex-the-result/m-p/533859#M2263</link>
      <description>&lt;P&gt;Splunk Noob.&lt;BR /&gt;I have a custom http sourcetype with multiple data sources. For one of these sources (aws:firehose), I need to concatenate a field value (ecs_task_definition) to the source value, then do a regex or an eval at some point to remove the trailing colon and numbers, preferably all at index time. I've been advised the field=ecs_task_definition will contain a few hundred dynamic values that will change from time to time, so I can't assign these statically.&lt;/P&gt;&lt;P&gt;My example:&lt;/P&gt;&lt;P&gt;sourcetype=httpevent&lt;/P&gt;&lt;P&gt;source=aws:billing&lt;BR /&gt;source=aws:s3&lt;BR /&gt;source=aws:inspector&lt;BR /&gt;source=aws:firehose&lt;/P&gt;&lt;P&gt;ecs_task_definition=arc-permission-service-worker:100&lt;BR /&gt;ecs_task_definition=arc-enrollment-service:182&lt;BR /&gt;ecs_task_definition=arc-reporting-service:234&lt;BR /&gt;ecs_task_definition=arc-tenant-service:332&lt;/P&gt;&lt;P&gt;I would like the final result to look like:&lt;/P&gt;&lt;P&gt;source=aws:firehose:arc-tenant-service&lt;BR /&gt;source=aws:firehose:arc-reporting-service&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have been trying to do this in props and transforms without success. I think I'm having both syntax problems added to a general lack of understanding of what I can and can't do at index time verses search time. Any help would be much appreciated. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 16:11:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/concatenate-a-field-to-my-source-and-regex-the-result/m-p/533859#M2263</guid>
      <dc:creator>ictrees28</dc:creator>
      <dc:date>2020-12-22T16:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate a field to my source and regex the result</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/concatenate-a-field-to-my-source-and-regex-the-result/m-p/533864#M2264</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229930"&gt;@ictrees28&lt;/a&gt;, if you are using version 7.2 or later, you can create or update any field with INGEST_EVAL easily. Since you will able to use the same syntax as EVAL, you can test your EVAL on search then apply to transform .&lt;/P&gt;&lt;P&gt;Sample;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;props.conf
[httpevent]
TRANSFORMS-update_source = update_source

transforms.conf
[update_source]
INGEST_EVAL = source:=source.":".mvindex(split(ecs_task_definition,":"),0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 17:02:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/concatenate-a-field-to-my-source-and-regex-the-result/m-p/533864#M2264</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2020-12-22T17:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate a field to my source and regex the result</title>
      <link>https://community.splunk.com/t5/Splunk-ITSI/concatenate-a-field-to-my-source-and-regex-the-result/m-p/533875#M2265</link>
      <description>&lt;P&gt;Thank you so much, that makes perfect sense.&amp;nbsp; &amp;nbsp;That said, it's still not extracting my ecs_task_definition field.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The internal index error message reads "&lt;SPAN class="t"&gt;Cannot&lt;/SPAN&gt; &lt;SPAN class="t"&gt;parse&lt;/SPAN&gt; &lt;SPAN class="t a"&gt;&lt;SPAN class="t"&gt;INGEST_EVAL&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="t"&gt;statement&lt;/SPAN&gt;&lt;SPAN&gt; "&lt;/SPAN&gt;&lt;SPAN class="t"&gt;source:&lt;/SPAN&gt; &lt;SPAN class="t"&gt;=&lt;/SPAN&gt; &lt;SPAN class="t"&gt;source.&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;.mvindex&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class="t"&gt;split&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN class="t"&gt;ecs_task_definition&lt;/SPAN&gt;&lt;SPAN&gt;,"&lt;/SPAN&gt;&lt;SPAN class="t"&gt;:&lt;/SPAN&gt;&lt;SPAN&gt;"),&lt;/SPAN&gt;&lt;SPAN class="t"&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;)" &lt;/SPAN&gt;&lt;SPAN class="t"&gt;into&lt;/SPAN&gt; &lt;SPAN class="t"&gt;component&lt;/SPAN&gt; &lt;SPAN class="t"&gt;parts&lt;/SPAN&gt; &lt;SPAN class="t"&gt;for&lt;/SPAN&gt; &lt;SPAN class="t"&gt;&lt;SPAN class="t h"&gt;update&lt;/SPAN&gt;_source&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="t"&gt;Not sure what I'm doing wrong.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Dec 2020 19:08:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-ITSI/concatenate-a-field-to-my-source-and-regex-the-result/m-p/533875#M2265</guid>
      <dc:creator>ictrees28</dc:creator>
      <dc:date>2020-12-22T19:08:14Z</dc:date>
    </item>
  </channel>
</rss>

