<?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 Can Splunk transform a log event before to be indexed? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108049#M22729</link>
    <description>&lt;P&gt;I have this log event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-02-01 17:23:46,877 query id=a0e22777-2aaf-4486-9a56-fd1dae24bb82{
  "start" : 1,
  "returned" : 0,
  "count" : 0
}query
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to index the same log event in splunk as follow:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
  "query_time" : "2013-02-01 17:23:46,877",
  "id" : a0e22777-2aaf-4486-9a56-fd1dae24bb82,
  "start" : 1,
  "returned" : 0,
  "count" : 0
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way to do it using transforms.conf and props.conf:?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Lp&lt;/P&gt;</description>
    <pubDate>Fri, 01 Feb 2013 17:46:10 GMT</pubDate>
    <dc:creator>lpolo</dc:creator>
    <dc:date>2013-02-01T17:46:10Z</dc:date>
    <item>
      <title>Can Splunk transform a log event before to be indexed?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108049#M22729</link>
      <description>&lt;P&gt;I have this log event:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-02-01 17:23:46,877 query id=a0e22777-2aaf-4486-9a56-fd1dae24bb82{
  "start" : 1,
  "returned" : 0,
  "count" : 0
}query
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to index the same log event in splunk as follow:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{
  "query_time" : "2013-02-01 17:23:46,877",
  "id" : a0e22777-2aaf-4486-9a56-fd1dae24bb82,
  "start" : 1,
  "returned" : 0,
  "count" : 0
}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Is there a way to do it using transforms.conf and props.conf:?&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Lp&lt;/P&gt;</description>
      <pubDate>Fri, 01 Feb 2013 17:46:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108049#M22729</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2013-02-01T17:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can Splunk transform a log event before to be indexed?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108050#M22730</link>
      <description>&lt;P&gt;Yes, sed to the rescue: &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.1/Data/Anonymizedatausingconfigurationfiles#Through_a_sed_script"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.1/Data/Anonymizedatausingconfigurationfiles#Through_a_sed_script&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Something along these lines, untested:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;SEDCMD-foo = s/([0-9- :,]+)\s+query\s+id=([0-9a-f]+){(.*)}query/{"query_time":"\1","id":"\2",\3}/
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Feb 2013 23:03:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108050#M22730</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2013-02-01T23:03:49Z</dc:date>
    </item>
    <item>
      <title>Re: Can Splunk transform a log event before to be indexed?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108051#M22731</link>
      <description>&lt;P&gt;Beware, the sed may occur after the timestamp extraction, verify your timestamp in splunk.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Feb 2013 00:35:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108051#M22731</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2013-02-02T00:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can Splunk transform a log event before to be indexed?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108052#M22732</link>
      <description>&lt;P&gt;Thanks Martin. I am going to tested this week.&lt;BR /&gt;
Lp&lt;/P&gt;</description>
      <pubDate>Mon, 04 Feb 2013 19:44:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108052#M22732</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2013-02-04T19:44:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can Splunk transform a log event before to be indexed?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108053#M22733</link>
      <description>&lt;P&gt;I took a different approach to solve the problem. I extracted the json portion of the log event using a regex. Then, I was able to use spath without any problem.&lt;/P&gt;

&lt;P&gt;Thanks,&lt;BR /&gt;
Lp&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2013 13:59:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Can-Splunk-transform-a-log-event-before-to-be-indexed/m-p/108053#M22733</guid>
      <dc:creator>lpolo</dc:creator>
      <dc:date>2013-03-13T13:59:35Z</dc:date>
    </item>
  </channel>
</rss>

