<?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: rex command to regex in transforms.conf in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-regex-in-transforms-conf/m-p/184541#M53158</link>
    <description>&lt;P&gt;Assuming this is a search time extraction, you simply need to identify the field to "look" at as SOURCE_KEY (if you omit that, the default SOURCE_KEY is _raw&lt;BR /&gt;
The regex is fine as, is. Since you are extracting a field and not asking Splunk to produce the key value pair dynamically... you specify it in the regex as you've done... and then you can, for documentation, specify the format.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
[procname]&lt;BR /&gt;
SOURCE_KEY = source&lt;BR /&gt;
REGEX = 3......(?P&lt;PROCNAME&gt;.+?)rly&lt;BR /&gt;
FORMAT = procname::$1&lt;BR /&gt;
&lt;/PROCNAME&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Be sure to call the stanza, procname, in my example from a REPORT- directive in the props.conf&lt;/P&gt;

&lt;P&gt;The transforms.conf spec &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/Admin/Transformsconf" target="newWindow"&gt;here&lt;/A&gt; shows a slightly different example, where the SOURCE_KEY defaults to raw and the transform is actually renaming the KEY of a KEY value pair already in the data... but it's the same principal.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
[netscreen-error-field]&lt;BR /&gt;
REGEX = device_id=[w+](?&lt;ERR&gt;[^:]+)&lt;BR /&gt;
FORMAT = err_code::$1&lt;BR /&gt;
&lt;/ERR&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles" target="other"&gt;Here&lt;/A&gt; is a complete walk through all sorts of search time extractions using props.conf and transforms.conf for reference.&lt;/P&gt;</description>
    <pubDate>Sat, 31 May 2014 15:15:37 GMT</pubDate>
    <dc:creator>rsennett_splunk</dc:creator>
    <dc:date>2014-05-31T15:15:37Z</dc:date>
    <item>
      <title>rex command to regex in transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-regex-in-transforms-conf/m-p/184540#M53157</link>
      <description>&lt;P&gt;This rex statement works in search command: rex field=source "3......(?P&lt;PROCNAME&gt;.+?)rly"&lt;BR /&gt;
I would like to convert it into REGEX statement in transforms.conf file.&lt;BR /&gt;
What should be the REGEX statement?&lt;/PROCNAME&gt;&lt;/P&gt;

&lt;P&gt;Thanks in advanced.&lt;/P&gt;</description>
      <pubDate>Fri, 30 May 2014 23:29:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-regex-in-transforms-conf/m-p/184540#M53157</guid>
      <dc:creator>ch_goh</dc:creator>
      <dc:date>2014-05-30T23:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: rex command to regex in transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-regex-in-transforms-conf/m-p/184541#M53158</link>
      <description>&lt;P&gt;Assuming this is a search time extraction, you simply need to identify the field to "look" at as SOURCE_KEY (if you omit that, the default SOURCE_KEY is _raw&lt;BR /&gt;
The regex is fine as, is. Since you are extracting a field and not asking Splunk to produce the key value pair dynamically... you specify it in the regex as you've done... and then you can, for documentation, specify the format.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
[procname]&lt;BR /&gt;
SOURCE_KEY = source&lt;BR /&gt;
REGEX = 3......(?P&lt;PROCNAME&gt;.+?)rly&lt;BR /&gt;
FORMAT = procname::$1&lt;BR /&gt;
&lt;/PROCNAME&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Be sure to call the stanza, procname, in my example from a REPORT- directive in the props.conf&lt;/P&gt;

&lt;P&gt;The transforms.conf spec &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1.1/Admin/Transformsconf" target="newWindow"&gt;here&lt;/A&gt; shows a slightly different example, where the SOURCE_KEY defaults to raw and the transform is actually renaming the KEY of a KEY value pair already in the data... but it's the same principal.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;BR /&gt;
[netscreen-error-field]&lt;BR /&gt;
REGEX = device_id=[w+](?&lt;ERR&gt;[^:]+)&lt;BR /&gt;
FORMAT = err_code::$1&lt;BR /&gt;
&lt;/ERR&gt;&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles" target="other"&gt;Here&lt;/A&gt; is a complete walk through all sorts of search time extractions using props.conf and transforms.conf for reference.&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2014 15:15:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-regex-in-transforms-conf/m-p/184541#M53158</guid>
      <dc:creator>rsennett_splunk</dc:creator>
      <dc:date>2014-05-31T15:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: rex command to regex in transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-regex-in-transforms-conf/m-p/184542#M53159</link>
      <description>&lt;P&gt;I'd also suggest &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.1/Knowledge/Createandmaintainsearch-timefieldextractionsthroughconfigurationfiles"&gt;this page&lt;/A&gt;.  It's a nice, easy walkthrough of using transforms.conf and props.conf for field extractions.&lt;/P&gt;</description>
      <pubDate>Sat, 31 May 2014 15:43:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-regex-in-transforms-conf/m-p/184542#M53159</guid>
      <dc:creator>wpreston</dc:creator>
      <dc:date>2014-05-31T15:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: rex command to regex in transforms.conf</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-command-to-regex-in-transforms-conf/m-p/184543#M53160</link>
      <description>&lt;P&gt;Thanks. But Splunk doesn't pick it up. Here is what I have in props.conf and transforms.conf.&lt;/P&gt;

&lt;P&gt;props.conf:&lt;BR /&gt;
[source::/logs/dxserver/3*_query_*.log]&lt;BR /&gt;
REPORT-queryLog = dsaname &lt;/P&gt;

&lt;P&gt;transforms.conf:&lt;BR /&gt;
[dsaname]&lt;BR /&gt;
SOURCE_KEY = source&lt;BR /&gt;
REGEX = 3......(?P&lt;DSANAME&gt;.+?)rly&lt;BR /&gt;
FORMAT = dsaname::$1&lt;/DSANAME&gt;&lt;/P&gt;

&lt;P&gt;Example of the source field = "/logs/dxserver/3wtxq20corerly1_query_20140601.log". I expect the dsaname field equals to 'core' (without the qoute).&lt;/P&gt;

&lt;P&gt;Any syntax or format errors? &lt;BR /&gt;
Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Jun 2014 17:48:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-command-to-regex-in-transforms-conf/m-p/184543#M53160</guid>
      <dc:creator>ch_goh</dc:creator>
      <dc:date>2014-06-02T17:48:22Z</dc:date>
    </item>
  </channel>
</rss>

