<?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: Understanding props and transforms in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87900#M22472</link>
    <description>&lt;P&gt;When you with extractions using &lt;CODE&gt;rex&lt;/CODE&gt; or directly in &lt;CODE&gt;props.conf&lt;/CODE&gt;, you tell Splunk what to call the fields by using the fieldnames within tags in the matching groups. When using the syntax used in transforms.conf, you use the FORMAT directive to achieve that instead. So, you need to change the regex a bit to reflect that, as the tags will now not be interpreted the same way and therefore cause the regex not to match. Remove the tags and you should be fine. So:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog-cisco]
REGEX = ^(?:\S*\s*){5}(\S*)[^%]*(%\S+)
FORMAT = hostname::$1 alert::$2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 06 Oct 2011 20:24:07 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2011-10-06T20:24:07Z</dc:date>
    <item>
      <title>Understanding props and transforms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87899#M22471</link>
      <description>&lt;P&gt;I'm trying to put into practice what I saw in Michael Wilde's Regex video with regards to making rex searches persistent.  I must be missing something because I'm not getting the results I'm after.&lt;/P&gt;

&lt;P&gt;(with help from many folks here) I've built a search regex like so.  It works perfectly from search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;^(?:\S*\s*){5}(?&amp;lt;hostname&amp;gt;\S*)[^%]*(?&amp;lt;alert&amp;gt;%\S+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now, I'm trying to make it persistent by adding those search elements to /local copies of props.conf and transforms.conf.&lt;/P&gt;

&lt;P&gt;Since this syslog search is geared mostly towards Cisco syslog output, I see that there is a cisco_syslog stanza in props.conf that I think I can use:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[cisco_syslog]
MAX_TIMESTAMP_LOOKAHEAD = 32
SHOULD_LINEMERGE = False
TIME_FORMAT = %b %d %H:%M:%S
TRANSFORMS = syslog-host
REPORT-syslog = syslog-extractions
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I copy the entry from default/props.conf and add it to local/props.conf and add the changes:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[cisco_syslog]
MAX_TIMESTAMP_LOOKAHEAD = 32
SHOULD_LINEMERGE = False
TIME_FORMAT = %b %d %H:%M:%S
TRANSFORMS = syslog-host
REPORT-syslog = syslog-extractions,syslog-cisco
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I add the corresponding stanza to local/transforms.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog-cisco]
REGEX = ^(?:\S*\s*){5}(?&amp;lt;hostname&amp;gt;\S*)[^%]*(?&amp;lt;alert&amp;gt;%\S+)
FORMAT = hostname::$1 alert::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Issue the | kv reload=true and change my search sourcetype=syslog, which I'd expect to at least show the new fields in the field picker, but alas, it does not.&lt;/P&gt;

&lt;P&gt;Can anyone point me to what I might have missed?&lt;/P&gt;

&lt;P&gt;With gratitude,&lt;BR /&gt;
L:x&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2011 19:36:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87899#M22471</guid>
      <dc:creator>jlixfeld</dc:creator>
      <dc:date>2011-10-06T19:36:02Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding props and transforms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87900#M22472</link>
      <description>&lt;P&gt;When you with extractions using &lt;CODE&gt;rex&lt;/CODE&gt; or directly in &lt;CODE&gt;props.conf&lt;/CODE&gt;, you tell Splunk what to call the fields by using the fieldnames within tags in the matching groups. When using the syntax used in transforms.conf, you use the FORMAT directive to achieve that instead. So, you need to change the regex a bit to reflect that, as the tags will now not be interpreted the same way and therefore cause the regex not to match. Remove the tags and you should be fine. So:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog-cisco]
REGEX = ^(?:\S*\s*){5}(\S*)[^%]*(%\S+)
FORMAT = hostname::$1 alert::$2
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Oct 2011 20:24:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87900#M22472</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-10-06T20:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding props and transforms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87901#M22473</link>
      <description>&lt;P&gt;Thanks for the pointer, however that didn't seem to work either.&lt;/P&gt;

&lt;P&gt;I modified transforms.conf and removed the tags as you suggested, | kv reload=true, but still I don't see any change in a new search output or in the field picker.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2011 21:07:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87901#M22473</guid>
      <dc:creator>jlixfeld</dc:creator>
      <dc:date>2011-10-06T21:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding props and transforms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87902#M22474</link>
      <description>&lt;P&gt;And you say this works with the normal rex command? Curious. What happens if you remove the leading "^"?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2011 07:14:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87902#M22474</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2011-10-07T07:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding props and transforms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87903#M22475</link>
      <description>&lt;P&gt;Quite simply, you applied your new extraction to the sourcetype &lt;CODE&gt;cisco_syslog&lt;/CODE&gt;, and so it will only be applied to events with that sourcetype. If you search for &lt;CODE&gt;sourcetype=syslog&lt;/CODE&gt;, you won't get any &lt;CODE&gt;cisco_syslog&lt;/CODE&gt; events (only &lt;CODE&gt;syslog&lt;/CODE&gt;), so it won't be applied.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2011 13:56:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87903#M22475</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-10-07T13:56:19Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding props and transforms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87904#M22476</link>
      <description>&lt;P&gt;Ah, that makes perfect sense.  Thank you.&lt;/P&gt;

&lt;P&gt;My syslog data input is udp:514, so conceptually speaking, what's the best common practise around using Splunk as a collector from multiple syslog sources (say a Cisco router, a Unix box, a XYZ device)?  I imagine it might be quite difficult to have a bunch of transforms on a single syslog stanza to try and account for the differences in many of the log formats, but is it doable?  Is it easier to have the local syslog daemon write to different files, let Splunk eat the files and use the different files to apply different formats or transforms?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2011 14:44:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87904#M22476</guid>
      <dc:creator>jlixfeld</dc:creator>
      <dc:date>2011-10-07T14:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding props and transforms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87905#M22477</link>
      <description>&lt;P&gt;So this is still giving me grief.&lt;/P&gt;

&lt;P&gt;I removed the &lt;CODE&gt;[cisco_syslog]&lt;/CODE&gt; stanza from &lt;CODE&gt;local/props.conf&lt;/CODE&gt; and replaced it with this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog]
pulldown_type = true
maxDist = 3
TIME_FORMAT = %b %d %H:%M:%S
MAX_TIMESTAMP_LOOKAHEAD = 32
TRANSFORMS = syslog-host
REPORT-syslog = syslog-extractions,syslog-cisco
SHOULD_LINEMERGE = False
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;My &lt;CODE&gt;local/transforms.conf&lt;/CODE&gt; looks has this as a corresponding entry:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[syslog-cisco]
REGEX = ^(?:\S*\s*){5}(\S*)[^%]*(%\S+)
FORMAT = hostname::$1 alert::$2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Still, on a &lt;CODE&gt;| kv reload=true&lt;/CODE&gt; or a &lt;CODE&gt;| extract reload=true&lt;/CODE&gt; followed by a subsequent search for &lt;CODE&gt;sourcetype=syslog&lt;/CODE&gt; I don't see the new fields in the field picker.&lt;/P&gt;

&lt;P&gt;Now I'm going on the assumption that if I have an entry in &lt;CODE&gt;local/props.conf&lt;/CODE&gt; that also exists in &lt;CODE&gt;default/props.conf&lt;/CODE&gt;, the &lt;CODE&gt;local&lt;/CODE&gt; entry will override the &lt;CODE&gt;default&lt;/CODE&gt; entry, so I'm not running into an issue where it's loading the &lt;CODE&gt;default&lt;/CODE&gt; entry first and ignoring my &lt;CODE&gt;local&lt;/CODE&gt; entry?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2011 17:13:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87905#M22477</guid>
      <dc:creator>jlixfeld</dc:creator>
      <dc:date>2011-10-07T17:13:26Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding props and transforms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87906#M22478</link>
      <description>&lt;P&gt;Ok, I solved this. I opted to use props.conf instead of props.conf + transforms.conf.  Here's what finally worked:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[source::udp:514]
EXTRACT-name = ^(?:\S*\s*){5}(?&amp;lt;hostname&amp;gt;\S*)[^%]*(?&amp;lt;alert&amp;gt;%\S+)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks again to everyone who chimed in.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2011 15:30:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87906#M22478</guid>
      <dc:creator>jlixfeld</dc:creator>
      <dc:date>2011-10-08T15:30:46Z</dc:date>
    </item>
    <item>
      <title>Re: Understanding props and transforms</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87907#M22479</link>
      <description>&lt;P&gt;Oh I just realized the problem in your original. If you have the fields named in the REGEX (e.g., &lt;CODE&gt;(?&amp;lt;alert&amp;gt;...)&lt;/CODE&gt;, then you should &lt;EM&gt;not&lt;/EM&gt; have a FORMAT line. The FORMAT line overwrote your extractions in the transforms.&lt;/P&gt;</description>
      <pubDate>Sat, 08 Oct 2011 18:46:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Understanding-props-and-transforms/m-p/87907#M22479</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-10-08T18:46:31Z</dc:date>
    </item>
  </channel>
</rss>

