<?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: Log transformation in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Log-transformation/m-p/147618#M185329</link>
    <description>&lt;P&gt;Something like this should do the job.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | rex "(?&amp;lt;field1&amp;gt;.*?)\s(?&amp;lt;field2&amp;gt;.*?)\.(?&amp;lt;field3&amp;gt;.*?)\s::(?&amp;lt;mon&amp;gt;.*?)/(?&amp;lt;day&amp;gt;.*?)/(?&amp;lt;year&amp;gt;.*?)\s(?&amp;lt;time&amp;gt;.*?)\s::\s(?&amp;lt;BS&amp;gt;.*?)\s::(?&amp;lt;msg&amp;gt;.*)" | eval trade=case(BS="B","Buy",BS="S","Sell") | eval output3=if(field3="####",field2,field1) | eval targetLog=trade." | ".year."/".mon."/".day." ".time." | ".msg | ...&lt;/CODE&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Nov 2013 13:01:47 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2013-11-19T13:01:47Z</dc:date>
    <item>
      <title>Log transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Log-transformation/m-p/147617#M185328</link>
      <description>&lt;P&gt;I have below requirement, some one Please guide how do I achieve using Splunk&lt;/P&gt;

&lt;P&gt;I have host called SourceHost where log files are generated and I have another host called TargetHost where I have to transform the source log and write.&lt;/P&gt;

&lt;P&gt;Source log&lt;BR /&gt;
SNM5 YAHOO3SN.#### :: 03/03/13 00:00:07 :: B ::User yahoo3sn logged in&lt;BR /&gt;
SNM4 YAHOO3SN.871F :: 03/03/13 00:00:07 :: S ::User logged off, Processing will begin&lt;/P&gt;

&lt;P&gt;Target log&lt;BR /&gt;
Buy  | 13/03/03 | YAHOO3SN |03/03/13 00:00:07 | User yahoo3sn logged in&lt;BR /&gt;
Sell | 13/03/03 | SNM4     |03/03/13 00:00:07 | logged off, Processing will begin&lt;/P&gt;

&lt;P&gt;where &lt;BR /&gt;
 1. B stands for buy and S stand for sell&lt;BR /&gt;
 2. Soruce date is mm/dd/yy and target date is yy/mm/dd&lt;BR /&gt;
 3. if third word in the log is "####" then pickup the second word otherwise pickup the first word.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2013 12:43:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Log-transformation/m-p/147617#M185328</guid>
      <dc:creator>srajanbabu</dc:creator>
      <dc:date>2013-11-19T12:43:11Z</dc:date>
    </item>
    <item>
      <title>Re: Log transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Log-transformation/m-p/147618#M185329</link>
      <description>&lt;P&gt;Something like this should do the job.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;... | rex "(?&amp;lt;field1&amp;gt;.*?)\s(?&amp;lt;field2&amp;gt;.*?)\.(?&amp;lt;field3&amp;gt;.*?)\s::(?&amp;lt;mon&amp;gt;.*?)/(?&amp;lt;day&amp;gt;.*?)/(?&amp;lt;year&amp;gt;.*?)\s(?&amp;lt;time&amp;gt;.*?)\s::\s(?&amp;lt;BS&amp;gt;.*?)\s::(?&amp;lt;msg&amp;gt;.*)" | eval trade=case(BS="B","Buy",BS="S","Sell") | eval output3=if(field3="####",field2,field1) | eval targetLog=trade." | ".year."/".mon."/".day." ".time." | ".msg | ...&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2013 13:01:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Log-transformation/m-p/147618#M185329</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2013-11-19T13:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Log transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Log-transformation/m-p/147619#M185330</link>
      <description>&lt;P&gt;Thanks for the swift response, however I have few concerns.&lt;BR /&gt;
I assume, this regex will be performed on indexed file, I would like this tranformation happend as I read the input file and If possible i want to tranfer the data to target host without a footprint in splunk server.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2013 13:18:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Log-transformation/m-p/147619#M185330</guid>
      <dc:creator>srajanbabu</dc:creator>
      <dc:date>2013-11-19T13:18:29Z</dc:date>
    </item>
    <item>
      <title>Re: Log transformation</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Log-transformation/m-p/147620#M185331</link>
      <description>&lt;P&gt;You won't be able to have Splunk process the log without indexing it.  You should be able to make the transformation happen on input by adding a similar REGEX statement to your transforms.conf file.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2013 13:52:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Log-transformation/m-p/147620#M185331</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2013-11-19T13:52:20Z</dc:date>
    </item>
  </channel>
</rss>

