<?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 create key/value pairs from a _raw field with only values? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-key-value-pairs-from-a-raw-field-with-only/m-p/99181#M25604</link>
    <description>&lt;P&gt;Using the IFX seemed to work for now.  I wasn't able to extract all the fields I was looking for, but I was able to get at what I needed for our purposes.&lt;/P&gt;

&lt;P&gt;Ideally, if I had the option to format the data before being sent to syslog, I'd be happy.  In fact, if Symantec didn't send Brightmail mail audit logs to syslog as separate events (each aspect of a single record is sent as a separate syslog event) I'd have a much easier time extracting fields.&lt;/P&gt;

&lt;P&gt;Thanks for the tips, BTW.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Aug 2013 00:01:21 GMT</pubDate>
    <dc:creator>joshua_hart</dc:creator>
    <dc:date>2013-08-10T00:01:21Z</dc:date>
    <item>
      <title>How do I create key/value pairs from a _raw field with only values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-key-value-pairs-from-a-raw-field-with-only/m-p/99178#M25601</link>
      <description>&lt;P&gt;I have a Symantec Messaging Gateway syslog input that provides syslog with no keys, only values.  For example: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2013-07-11T13:13:16-04:00 appliance-name ecelerity: 1373562795|d6038c16-b7fe96d000000710-2d-51dee7aae3dd|SENDER|some-email-address@domain.tld
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Right now this entire event is contained within the "_raw" field.  The log data is everything after "ecelerity:" and each value is delimited by a pipe character.  What I'd like to do is create fields for those values and then index the event so I can search on those fields.  The example above would have five fields:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Epoch Time&lt;/LI&gt;
&lt;LI&gt;Unique ID&lt;/LI&gt;
&lt;LI&gt;Action&lt;/LI&gt;
&lt;LI&gt;Sender Address&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;It's important to note that the above example is but one among many.  Some of the other events have more values and the keys for those values will differ based on the type of event (though everything up to and including the 'Action' field would be consistent across events).&lt;/P&gt;

&lt;P&gt;What I need is the means to parse these events and then create rules for each event to add keys to the values.  How can I do this?  I'm thinking something in the props/transforms, but I'm not exactly sure how.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 12:18:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-key-value-pairs-from-a-raw-field-with-only/m-p/99178#M25601</guid>
      <dc:creator>joshua_hart</dc:creator>
      <dc:date>2013-07-18T12:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create key/value pairs from a _raw field with only values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-key-value-pairs-from-a-raw-field-with-only/m-p/99179#M25602</link>
      <description>&lt;P&gt;You could start with the Splunk Interactive Field Extractor (IFX) to parse out your fields for you.  It will generate the appropriate regex for you. Sometimes it may need to be tweaked though.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/view/SP-CAAADUY"&gt;http://www.splunk.com/view/SP-CAAADUY&lt;/A&gt;&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/Knowledge/ExtractfieldsinteractivelywithIFX"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/Knowledge/ExtractfieldsinteractivelywithIFX&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;And yes you are correct that you'll use props.conf and transforms.conf to manually extract out fields.  The IFX will write out data to those config files so you'll see the examples it creates. You should see those additions under $SPLUNK_HOME/etc/users.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/Knowledge/Addfieldsatsearchtime"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/Knowledge/Addfieldsatsearchtime&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;There is also a way to extract fields on the fly in a search if it's something less common and you don't already have a field:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/Search/Extractfieldswithsearchcommands"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/Search/Extractfieldswithsearchcommands&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 14:49:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-key-value-pairs-from-a-raw-field-with-only/m-p/99179#M25602</guid>
      <dc:creator>sdaniels</dc:creator>
      <dc:date>2013-07-18T14:49:14Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create key/value pairs from a _raw field with only values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-key-value-pairs-from-a-raw-field-with-only/m-p/99180#M25603</link>
      <description>&lt;P&gt;If your data originates from a file that contains a header, I would use automatic header-based fields:  &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/Data/Extractfieldsfromfileheadersatindextime"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/Data/Extractfieldsfromfileheadersatindextime&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2013 20:18:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-key-value-pairs-from-a-raw-field-with-only/m-p/99180#M25603</guid>
      <dc:creator>the_wolverine</dc:creator>
      <dc:date>2013-07-18T20:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create key/value pairs from a _raw field with only values?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-key-value-pairs-from-a-raw-field-with-only/m-p/99181#M25604</link>
      <description>&lt;P&gt;Using the IFX seemed to work for now.  I wasn't able to extract all the fields I was looking for, but I was able to get at what I needed for our purposes.&lt;/P&gt;

&lt;P&gt;Ideally, if I had the option to format the data before being sent to syslog, I'd be happy.  In fact, if Symantec didn't send Brightmail mail audit logs to syslog as separate events (each aspect of a single record is sent as a separate syslog event) I'd have a much easier time extracting fields.&lt;/P&gt;

&lt;P&gt;Thanks for the tips, BTW.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Aug 2013 00:01:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-create-key-value-pairs-from-a-raw-field-with-only/m-p/99181#M25604</guid>
      <dc:creator>joshua_hart</dc:creator>
      <dc:date>2013-08-10T00:01:21Z</dc:date>
    </item>
  </channel>
</rss>

