<?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: Field extraction and regex strategy in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-and-regex-strategy/m-p/94154#M24250</link>
    <description>&lt;P&gt;1) You might be interested in looking at the &lt;A href="http://splunk-base.splunk.com/apps/22291/field-extractor"&gt;Field Extractor app&lt;/A&gt; which will generate the regexes for you, if you just click on the values you want extracted. &lt;/P&gt;

&lt;P&gt;2) you can have one regex to pull out both values.  Something like "FLETCHER\\(?&lt;ORG&gt;\w+).*?(?&lt;USAGE&gt;\d+) bytes"&lt;/USAGE&gt;&lt;/ORG&gt;&lt;/P&gt;

&lt;P&gt;3) you search needs to be something like:  sourcetype=SFTP_records  | stats sum(bytes) by org&lt;/P&gt;</description>
    <pubDate>Tue, 10 Jul 2012 00:22:17 GMT</pubDate>
    <dc:creator>carasso</dc:creator>
    <dc:date>2012-07-10T00:22:17Z</dc:date>
    <item>
      <title>Field extraction and regex strategy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-and-regex-strategy/m-p/94153#M24249</link>
      <description>&lt;P&gt;I have log that looks like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2012-02-23 09:25:21 VShellSSH2 sftp 108660 172.59.56.8 62386 NESTLE - C:\SFTP\NESTLE\file.csv 0 0 350754 350754 - - "108660: FLETCHER\NESTLE has accessed 'C:\SFTP\NESTLE\file.csv 350754 bytes downloaded"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need to figure out a way to apply field extractions to extract  the name of the org (which usually appears after the keyword FLETCHER\ ) and then similarly extract the # of bytes downloaded.&lt;/P&gt;

&lt;P&gt;Any pointers so as to how I should go about it ? &lt;/P&gt;

&lt;P&gt;Here's what Im thinking :&lt;/P&gt;

&lt;P&gt;i) I will create a field extraction to pick out the name of the org - eg. NESTLE in this case&lt;BR /&gt;
This field will be called &lt;STRONG&gt;org&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;ii) I will create a regex that will filter out the # of bytes downloaded. this field will be called &lt;STRONG&gt;usage&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;iii) I will do a &lt;STRONG&gt;sourcetype=SFTP_records stats bytes by org&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Does that make sense ? There are multiple events like these for every ORG and needless to say there are multiple ORGS&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2012 00:16:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-and-regex-strategy/m-p/94153#M24249</guid>
      <dc:creator>asarolkar</dc:creator>
      <dc:date>2012-07-10T00:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Field extraction and regex strategy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-extraction-and-regex-strategy/m-p/94154#M24250</link>
      <description>&lt;P&gt;1) You might be interested in looking at the &lt;A href="http://splunk-base.splunk.com/apps/22291/field-extractor"&gt;Field Extractor app&lt;/A&gt; which will generate the regexes for you, if you just click on the values you want extracted. &lt;/P&gt;

&lt;P&gt;2) you can have one regex to pull out both values.  Something like "FLETCHER\\(?&lt;ORG&gt;\w+).*?(?&lt;USAGE&gt;\d+) bytes"&lt;/USAGE&gt;&lt;/ORG&gt;&lt;/P&gt;

&lt;P&gt;3) you search needs to be something like:  sourcetype=SFTP_records  | stats sum(bytes) by org&lt;/P&gt;</description>
      <pubDate>Tue, 10 Jul 2012 00:22:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-extraction-and-regex-strategy/m-p/94154#M24250</guid>
      <dc:creator>carasso</dc:creator>
      <dc:date>2012-07-10T00:22:17Z</dc:date>
    </item>
  </channel>
</rss>

