<?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: How to automatically extract key value pairs after using translatefix in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332777#M61560</link>
    <description>&lt;P&gt;can you share sample data after it was decoded? (in plain text)&lt;/P&gt;</description>
    <pubDate>Tue, 18 Apr 2017 12:37:39 GMT</pubDate>
    <dc:creator>adonio</dc:creator>
    <dc:date>2017-04-18T12:37:39Z</dc:date>
    <item>
      <title>How to automatically extract key value pairs after using translatefix</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332776#M61559</link>
      <description>&lt;P&gt;I have used translatefix to decode the fix messages logs and it worked fine. But Splunk is not able to automatically extract key-value pairs. I don't want to write extract kvdelims and pairdelims in each search. How can I automatically extract key-values using configuration files&lt;/P&gt;

&lt;P&gt;My Original data:&lt;BR /&gt;
19:14:59.338308 outgoing: 8=FIX.4.X|9=12|35=0|34=123456|49=ABC1|52=20170406-23:14:59.338|56=XYZ1|10=123|&lt;/P&gt;

&lt;P&gt;After using translatefix as command:&lt;BR /&gt;
index=abc sourcetype=xyz | translatefix&lt;BR /&gt;
data is decoded as:&lt;/P&gt;

&lt;P&gt;19:14:59.338308 outgoing: BeginString=FIX.4.X BodyLength=12 MsgType=Heartbeat MsgSeqNum=123456 SenderCompID=ABC1 SendingTime=20170406-23:14:59.338 TargetCompID=XYZ1 CheckSum=123&lt;/P&gt;

&lt;P&gt;To extract key value pair I have to use extract command in search like below:&lt;/P&gt;

&lt;P&gt;ndex="abc" sourcetype=xyz | translatefix | extract pairdelim=" " kvdelim="=" . &lt;BR /&gt;
Is there any way I can configure to extract automatically using conf files (props.conf, transforms.conf). So I dont have to write extract in each search query and data is extracted automatically. &lt;/P&gt;

&lt;P&gt;I tried using delims and regex (\w+)=([^[\s]+) in transforms.conf. It worked for original data but not working after using translatefix command.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 10:24:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332776#M61559</guid>
      <dc:creator>isha_rastogi</dc:creator>
      <dc:date>2017-04-18T10:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically extract key value pairs after using translatefix</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332777#M61560</link>
      <description>&lt;P&gt;can you share sample data after it was decoded? (in plain text)&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 12:37:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332777#M61560</guid>
      <dc:creator>adonio</dc:creator>
      <dc:date>2017-04-18T12:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically extract key value pairs after using translatefix</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332778#M61561</link>
      <description>&lt;P&gt;Yes Sure. &lt;/P&gt;

&lt;P&gt;My Original data:&lt;BR /&gt;
19:14:59.338308 outgoing: 8=FIX.4.X|9=12|35=0|34=123456|49=ABC1|52=20170406-23:14:59.338|56=XYZ1|10=123|&lt;/P&gt;

&lt;P&gt;After using translatefix as command:&lt;BR /&gt;
index=abc sourcetype=xyz | translatefix&lt;BR /&gt;
data is decoded as:&lt;/P&gt;

&lt;P&gt;19:14:59.338308 outgoing: BeginString=FIX.4.X BodyLength=12 MsgType=Heartbeat MsgSeqNum=123456 SenderCompID=ABC1 SendingTime=20170406-23:14:59.338 TargetCompID=XYZ1 CheckSum=123&lt;/P&gt;

&lt;P&gt;To extract key value pair I have to use extract command in search like below:&lt;/P&gt;

&lt;P&gt;ndex="abc" sourcetype=xyz | translatefix | extract pairdelim=" " kvdelim="=" . &lt;BR /&gt;
Is there any way I can configure to extract automatically using conf files (props.conf, transforms.conf)&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 13:28:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332778#M61561</guid>
      <dc:creator>isha_rastogi</dc:creator>
      <dc:date>2017-04-18T13:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically extract key value pairs after using translatefix</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332779#M61562</link>
      <description>&lt;P&gt;In the props.conf (on the search head or wherever users log in), add the following:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[xyz]
KV_MODE = auto
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the key-value pairs (separated by &lt;span class="lia-unicode-emoji" title=":grinning_face_with_big_eyes:"&gt;😃&lt;/span&gt; will be extracted. You do not need the transforms.conf.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Apr 2017 15:38:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332779#M61562</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-04-18T15:38:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically extract key value pairs after using translatefix</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332780#M61563</link>
      <description>&lt;P&gt;Tried to put KV_MODE =auto. No success :(.  ( Tried on new indexed data)&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 06:20:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332780#M61563</guid>
      <dc:creator>isha_rastogi</dc:creator>
      <dc:date>2017-04-19T06:20:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically extract key value pairs after using translatefix</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332781#M61564</link>
      <description>&lt;P&gt;Okay, I gave a dumb answer because I didn't realize that you are using translatefix inline. If you are reformatting the data on the fly (which is how translatefix works), you can't put the field extractions in props.conf or transforms.conf based on the NEW format.&lt;/P&gt;

&lt;P&gt;However, you can certainly add the field extractions based on the original/stored format. Of course, in the original format, you don't get the "real" field names, instead you get weird names like "10" and "56." To make the names pretty, you would need to do a bunch of renames, which doesn't really help either.&lt;/P&gt;

&lt;P&gt;I suggest a macro. Let's call it &lt;CODE&gt;infixed_xyz()&lt;/CODE&gt; and let the body of the macro be&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=xyz | translatefix | extract pairdelim=" " kvdelim="="
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;now you can write a search like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc `infixed_xyx` | where TargetCompID=XYZ1 | stats or whatever
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Apr 2017 20:19:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332781#M61564</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2017-04-19T20:19:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to automatically extract key value pairs after using translatefix</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332782#M61565</link>
      <description>&lt;P&gt;As translatefix is configured in commands.conf and I'm using it as command. Can I configure it in configuration file so that it will be automatically applied instead of writing it inline. &lt;/P&gt;</description>
      <pubDate>Thu, 20 Apr 2017 15:50:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-to-automatically-extract-key-value-pairs-after-using/m-p/332782#M61565</guid>
      <dc:creator>isha_rastogi</dc:creator>
      <dc:date>2017-04-20T15:50:19Z</dc:date>
    </item>
  </channel>
</rss>

