<?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 extract data? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29630#M5992</link>
    <description>&lt;P&gt;I don't think you should have a ; in your kvdelim just an "=", as such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=idx_FOO myvariable="GP_FOO" | extract pairdelim=";", kvdelim="=", auto=f
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should put you where you want to be.&lt;/P&gt;</description>
    <pubDate>Fri, 21 Jan 2011 00:55:24 GMT</pubDate>
    <dc:creator>Lamar</dc:creator>
    <dc:date>2011-01-21T00:55:24Z</dc:date>
    <item>
      <title>How to extract data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29629#M5991</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;i am trying to extract from a search some data, and split the data into two fields with values.&lt;/P&gt;

&lt;P&gt;So far i only managed to extract one field. How can i extract also the other?&lt;/P&gt;

&lt;P&gt;Data Sample:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2010-01-20  16:55:45    0.0000  50.10.12.16 GP  GP_FOO  -   35  ja  -   19.1    AB  -   TST-00000   12355678    S12345678   FOOKey=5;FOOKeyM=0;

2010-01-20  16:56:45    0.0000  15.28.12.19 GP  GP_FOO  -   35  ja  -   49.1    AB  -   TST-00000   12345678    S12545678   FOOKey=10;FOOKeyM=3;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Here´s the search i am using so far:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=idx_FOO myvariable="GP_FOO" | extract pairdelim=";", kvdelim="=;", auto=f
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It delivers me the field "FOOKeyM"+value. But i also want "FOOKey" to get extracted. I don´t know any further. How can i achieve this?&lt;/P&gt;

&lt;P&gt;Thomas &lt;/P&gt;

&lt;P&gt;p.s. I don´t want to extract the fields in props or transform.conf. It´s only for a one time report.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2011 00:30:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29629#M5991</guid>
      <dc:creator>tpaulsen</dc:creator>
      <dc:date>2011-01-21T00:30:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29630#M5992</link>
      <description>&lt;P&gt;I don't think you should have a ; in your kvdelim just an "=", as such:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=idx_FOO myvariable="GP_FOO" | extract pairdelim=";", kvdelim="=", auto=f
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should put you where you want to be.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2011 00:55:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29630#M5992</guid>
      <dc:creator>Lamar</dc:creator>
      <dc:date>2011-01-21T00:55:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29631#M5993</link>
      <description>&lt;P&gt;1) Are you sure Splunk wasnt extracting it automatically even without the &lt;CODE&gt;extract command&lt;/CODE&gt;?   I ask because Splunk always does foo=bar extraction automatically when it sees equal signs.   &lt;/P&gt;

&lt;P&gt;Although perhaps it was thrown off by the semicolon im not sure. Worth double checking cause if so, less is more. &lt;/P&gt;

&lt;P&gt;2) If it really is just these fields it might be  better to go with a standard rex command rather than trying to use extract.  rex is a better tool across a wider range of situations, and the process of turning rex into a proper extraction is just a copy paste.. &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| rex "FOOkey=(?&amp;lt;FOOkey&amp;gt;.+);FooKeyM=(?&amp;lt;FOOkeyM&amp;gt;.+)"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2011 00:58:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29631#M5993</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-01-21T00:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29632#M5994</link>
      <description>&lt;P&gt;Ah, that works like a charm!&lt;BR /&gt;
I was previously trying this: &lt;/P&gt;

&lt;P&gt;| rex "(?i)^(?:[^\-]*\-){6}\d+\t\d+\t\w+\t(?P&lt;FKEYS&gt;.+)"&lt;/FKEYS&gt;&lt;/P&gt;

&lt;P&gt;But that only selects the whole FOOkey Terms.&lt;/P&gt;

&lt;P&gt;Thank you Nick!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2011 15:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29632#M5994</guid>
      <dc:creator>tpaulsen</dc:creator>
      <dc:date>2011-01-21T15:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29633#M5995</link>
      <description>&lt;P&gt;Sorry, that selects only the "FOOkeyM" part. i think Nick is right, and the best approach in this case is a regular expression.&lt;BR /&gt;
But thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2011 15:38:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29633#M5995</guid>
      <dc:creator>tpaulsen</dc:creator>
      <dc:date>2011-01-21T15:38:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29634#M5996</link>
      <description>&lt;P&gt;p.s. No it doesn´t extract the data automatically. I was just using foo for the example here. Security, you know...;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jan 2011 15:41:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29634#M5996</guid>
      <dc:creator>tpaulsen</dc:creator>
      <dc:date>2011-01-21T15:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract data?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29635#M5997</link>
      <description>&lt;P&gt;yea, i figured. (but for any other readers reading this thread note that in most cases 'foo=12 bar=21' will get autoextracted with no need for either rex nor extract. Here something throws it off, possibly the semicolon)&lt;/P&gt;</description>
      <pubDate>Sat, 22 Jan 2011 02:37:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-data/m-p/29635#M5997</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-01-22T02:37:46Z</dc:date>
    </item>
  </channel>
</rss>

