<?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 do I extract Key Value pairs from Ruby on Rails logs? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-Key-Value-pairs-from-Ruby-on-Rails-logs/m-p/86088#M21968</link>
    <description>&lt;P&gt;You can do this via configuration files or search-time "kv" (aka extract command).   Specifically, for your situation you want to delimit based on the "=&amp;gt;" and ", ".   You can use the extract command as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | extract pairdelim=", }{", kvdelim="=&amp;gt;", auto=f 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will turn off auto extraction, break the key value pairs based on the =&amp;gt;, and break the pairs based on the "," whitespace, or either curly bracket.  So your extracted fields would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;item1=food
item2=drink
item3=water
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 09 Nov 2010 06:40:28 GMT</pubDate>
    <dc:creator>Simeon</dc:creator>
    <dc:date>2010-11-09T06:40:28Z</dc:date>
    <item>
      <title>How do I extract Key Value pairs from Ruby on Rails logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-Key-Value-pairs-from-Ruby-on-Rails-logs/m-p/86087#M21967</link>
      <description>&lt;P&gt;I am trying to extract field and key/value parameters from a ruby on rails log file.   What ways can I do this?  My events have Parameters in the following format:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Processing blah blah blah
  Parameters:  {"item1"=&amp;gt;"food", "item2"=&amp;gt;"drink", "item3"=&amp;gt;"water"}
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Nov 2010 06:37:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-Key-Value-pairs-from-Ruby-on-Rails-logs/m-p/86087#M21967</guid>
      <dc:creator>Simeon</dc:creator>
      <dc:date>2010-11-09T06:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: How do I extract Key Value pairs from Ruby on Rails logs?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-Key-Value-pairs-from-Ruby-on-Rails-logs/m-p/86088#M21968</link>
      <description>&lt;P&gt;You can do this via configuration files or search-time "kv" (aka extract command).   Specifically, for your situation you want to delimit based on the "=&amp;gt;" and ", ".   You can use the extract command as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | extract pairdelim=", }{", kvdelim="=&amp;gt;", auto=f 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will turn off auto extraction, break the key value pairs based on the =&amp;gt;, and break the pairs based on the "," whitespace, or either curly bracket.  So your extracted fields would be:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;item1=food
item2=drink
item3=water
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Nov 2010 06:40:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-extract-Key-Value-pairs-from-Ruby-on-Rails-logs/m-p/86088#M21968</guid>
      <dc:creator>Simeon</dc:creator>
      <dc:date>2010-11-09T06:40:28Z</dc:date>
    </item>
  </channel>
</rss>

