<?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 Re: Using a transform i cant use SEDCMD in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315786#M59092</link>
    <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;The problem is that the 2 rules are for index time.&lt;BR /&gt;
The first transform will apply renaming the sourcetype original to new(AMBER_RAW:METRIC).&lt;BR /&gt;
But the event will not be parsed a second time (at index time) for the new sourcetype rules. Therefore the SEDCMD will never happen.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE : at search time. the new sourcetype rules may stilll apply ( by example a field extraction)&lt;/STRONG&gt;&lt;BR /&gt;
so you will need to use sedcmd at search time like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;your_index&amp;gt; sourcetype=AMBER_RAW:METRIC |  rex mode=sed "s/^.*?{/{/1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As per below doc &lt;BR /&gt;
&lt;A href="http://wiki.splunk.com/Community:HowIndexingWorks"&gt;http://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt;&lt;BR /&gt;
Both SEDCMD and transforms.conf occurs during 'Typing' queue process and since data is coming for &lt;CODE&gt;original sourcetype&lt;/CODE&gt;  so configuration for &lt;CODE&gt;original sourcetype&lt;/CODE&gt; will take effect and configuration (index-time) for &lt;CODE&gt;new sourcetype(AMBER_RAW:METRIC )&lt;/CODE&gt; will never take place.&lt;/P&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
    <pubDate>Fri, 06 Apr 2018 12:28:43 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2018-04-06T12:28:43Z</dc:date>
    <item>
      <title>Using a transform i cant use SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315785#M59091</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;I am taking in data and making a new source type, so i need to use a transform for this.&lt;BR /&gt;
The issue is when i use this i cant seem to use SEDCMD to trim some of the lines i am taking in.&lt;/P&gt;

&lt;P&gt;Props.conf&lt;BR /&gt;
    [AMBER_RAW:METRIC]&lt;BR /&gt;
    SEDCMD-remove_header = s/^.*?{/{/1&lt;BR /&gt;
    TIME_FORMAT = %Y-%m-%dT%H:%M:%S.%3N&lt;BR /&gt;
    TIME_PREFIX = \"ts\":\"&lt;BR /&gt;
    INDEXED_EXTRACTIONS = JSON&lt;/P&gt;

&lt;P&gt;Transform.conf&lt;BR /&gt;
    [AMBER_RAW_json_METRIC]&lt;BR /&gt;
    DEST_KEY = MetaData:Sourcetype&lt;BR /&gt;
    REGEX = {"v":"1.0\"&lt;BR /&gt;
    FORMAT = sourcetype::AMBER_RAW:METRIC&lt;/P&gt;

&lt;P&gt;If i don't use the Transform the SEDCMD-remove_header works, but in the case i need to, for another issue i am having.&lt;/P&gt;

&lt;P&gt;Any ideas, how to get around this?&lt;BR /&gt;
Example of the data, but i have it working if i take it in difectly. However i have to use a transform in this case as i have multiple sourcetype in one files.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2018-01-10 15:50:03 [metrics-application-1-thread-1] INFO  METRIC:41 - {"v":"1.0","t":"MTR","ts":"2018-01-10T15:50:03.704Z","h":"mx7654vm","pid":12483,"src":{"c":"authn-app","d":"auth"},"mtr":{"counters":{"process":{"cpu":{"time_cumulated_s":35},"memory":{"gc":{"ps_marksweep":{"total_duration_ms":814},"ps_scavenge":{"total_duration_ms":539}}}}},"gauges":{"com.murex.serviceframework.rest.datalayer.DataSourceMetrics.datasources.authn-authn-app-1":{"availableConnectionCount":1,"borrowedConnectionCount":0,"currPoolSize":1,"maxPoolSize":50,"poolName":"authn-authn-app-1"},"process":{"cpu":{"percentage":0.0014801778579070887},"files":{"open_files":37},"memory":{"jvm":{"heap":{"committed_kb":195072,"used_kb":111654},"nonheap":{"committed_kb":91456,"used_kb":89829}},"rss_kb":32880864,"vsz_kb":2295108}}},"histograms":{},"meters":{},"timers":{"process":{"memory":{"gc":{"ps_marksweep":{"events":{"count":1,"rate_1m":0.010541994097562058,"rate_5m":0.0030413993186727347,"rate_15m":0.001077675326868502,"rate_mean":0.023586525047214212},"duration_ms":{"max":620.0,"mean":620.0,"median":620.0,"min":620.0,"percentile_75":620.0,"percentile_95":620.0,"percentile_98":620.0,"percentile_99":620.0,"percentile_999":620.0,"standard_deviation":0.0}},"ps_scavenge":{"events":{"count":32,"rate_1m":1.3370365746688775,"rate_5m":1.8460208181687348,"rate_15m":1.9473463934310977,"rate_mean":0.7547234936660224},"duration_ms":{"max":18.0,"mean":9.125,"median":6.5,"min":3.0,"percentile_75":13.0,"percentile_95":18.0,"percentile_98":18.0,"percentile_99":18.0,"percentile_999":18.0,"standard_deviation":5.014495118187132}}}}}}}}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks, in advance&lt;BR /&gt;
Rob&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:53:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315785#M59091</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2020-09-29T18:53:48Z</dc:date>
    </item>
    <item>
      <title>Re: Using a transform i cant use SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315786#M59092</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;

&lt;P&gt;The problem is that the 2 rules are for index time.&lt;BR /&gt;
The first transform will apply renaming the sourcetype original to new(AMBER_RAW:METRIC).&lt;BR /&gt;
But the event will not be parsed a second time (at index time) for the new sourcetype rules. Therefore the SEDCMD will never happen.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;NOTE : at search time. the new sourcetype rules may stilll apply ( by example a field extraction)&lt;/STRONG&gt;&lt;BR /&gt;
so you will need to use sedcmd at search time like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=&amp;lt;your_index&amp;gt; sourcetype=AMBER_RAW:METRIC |  rex mode=sed "s/^.*?{/{/1"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As per below doc &lt;BR /&gt;
&lt;A href="http://wiki.splunk.com/Community:HowIndexingWorks"&gt;http://wiki.splunk.com/Community:HowIndexingWorks&lt;/A&gt;&lt;BR /&gt;
Both SEDCMD and transforms.conf occurs during 'Typing' queue process and since data is coming for &lt;CODE&gt;original sourcetype&lt;/CODE&gt;  so configuration for &lt;CODE&gt;original sourcetype&lt;/CODE&gt; will take effect and configuration (index-time) for &lt;CODE&gt;new sourcetype(AMBER_RAW:METRIC )&lt;/CODE&gt; will never take place.&lt;/P&gt;

&lt;P&gt;let me know if this helps!&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 12:28:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315786#M59092</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-04-06T12:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Using a transform i cant use SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315787#M59093</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;

&lt;P&gt;Thanks. Do you think i can move it from one transform to another so i can take out this data?&lt;/P&gt;

&lt;P&gt;Is there anything that can be done to help in this case.&lt;/P&gt;

&lt;P&gt;I need to push this data into a datamodel this is why i need this.&lt;/P&gt;

&lt;P&gt;Thanks&lt;BR /&gt;
Robert&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 13:16:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315787#M59093</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2018-04-06T13:16:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using a transform i cant use SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315788#M59094</link>
      <description>&lt;P&gt;again it will conflict. well what you can do is try applying sedcmd and transforms on the original sourcetype and see what happens.this should work as you are applying configuration on the original sourcetype.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 13:23:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315788#M59094</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-04-06T13:23:31Z</dc:date>
    </item>
    <item>
      <title>Re: Using a transform i cant use SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315789#M59095</link>
      <description>&lt;P&gt;@mayurr98 is correct about the order of operations in the indexing pipeline.  To get around this, you could use  &lt;CODE&gt;CLONE_SOURCETYPE&lt;/CODE&gt; in transforms.conf.  According to the &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Admin/Transformsconf"&gt;documentation&lt;/A&gt;, "The cloned event will be further processed by index-time transforms and SEDCMD expressions according to its new sourcetype."&lt;/P&gt;</description>
      <pubDate>Fri, 06 Apr 2018 14:47:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315789#M59095</guid>
      <dc:creator>jconger</dc:creator>
      <dc:date>2018-04-06T14:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Using a transform i cant use SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315790#M59096</link>
      <description>&lt;P&gt;hi &lt;BR /&gt;
 Thanks for this this worked &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 21:22:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315790#M59096</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2018-04-09T21:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using a transform i cant use SEDCMD</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315791#M59097</link>
      <description>&lt;P&gt;HI &lt;/P&gt;

&lt;P&gt;Thanks for this, the first answer did work for me. But this is good to know for the future.&lt;/P&gt;

&lt;P&gt;Cheers&lt;BR /&gt;
Robert&lt;/P&gt;</description>
      <pubDate>Mon, 09 Apr 2018 21:22:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-a-transform-i-cant-use-SEDCMD/m-p/315791#M59097</guid>
      <dc:creator>robertlynch2020</dc:creator>
      <dc:date>2018-04-09T21:22:56Z</dc:date>
    </item>
  </channel>
</rss>

