<?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 - Separate on Colon? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29754#M6011</link>
    <description>&lt;P&gt;I think I get what you are trying to do and you need to break it into phases.  Phase A gives you all 45 fields delimited with the colon, Phase B was a bit weird so field f40 is broken into two with the -l flag as the delimiter.   Phase C breaks f46 apart using a REGEX by flag type.  Finally, Phase D uses nested delims to break the f47 field into the final name/value pair.  If you try this, just run a search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="yoursourcetype" | table f* h_* mem* vir*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
REPORT-extractions = a,b,c,d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[a]
DELIMS = ":"
FIELDS= f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45

[b]
SOURCE_KEY = f40
REGEX = (.*)-l(.*)
FORMAT = f46::$1 f47::$2

[c]
SOURCE_KEY = f46
REGEX = -u (.+?) -q (.+?)$
FORMAT = f48::$1 f49::$2

[d]
SOURCE_KEY=f47
DELIMS = ",","="
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 08 Aug 2012 21:37:10 GMT</pubDate>
    <dc:creator>dmaislin_splunk</dc:creator>
    <dc:date>2012-08-08T21:37:10Z</dc:date>
    <item>
      <title>Field Extraction - Separate on Colon?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29751#M6008</link>
      <description>&lt;P&gt;I'm trying to extract -all- the fields from a rather complex Oracle Grid Engine log file with a format like this:&lt;/P&gt;

&lt;P&gt;all.q:50s01fb:clusterusers:zarakhov:transc4desc.fasta_$SGE_TASK_ID.qsub:5161781:sge:0:1344452577:1344452604:1344452617:0:0:13:8.781664:0.452931:0.000000:0:0:0:0:332711:716:0:0.000000:0:0:0:0:12147:13606:normal:MPRICompGenomics:NONE:1:987:9.234595:1.061786:0.000000:-u zarakhov -q all.q -l h_rt=21600,h_vmem=2G,mem_free=2G,mem_reserve=2G,virtual_free=2G:0.000000:NONE:383160320.000000:0:0&lt;/P&gt;

&lt;P&gt;Obviously, I'd like to separate on the colons and dump each of the variables into a sequentially labeled variable (fieldname1-fieldname27 or whatnot). I've found fairly easy ways to extract the fields one at a time, is there a mechanism for doing in a more efficient way? Like the split command in perl?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 12:13:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29751#M6008</guid>
      <dc:creator>holtb</dc:creator>
      <dc:date>2020-09-28T12:13:35Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction - Separate on Colon?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29752#M6009</link>
      <description>&lt;P&gt;take a look at the extract command for the search command.&lt;BR /&gt;
... | extract pairdelim=",", kvdelim="="&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/4.3.3/SearchReference/Extract"&gt;http://docs.splunk.com/Documentation/Splunk/4.3.3/SearchReference/Extract&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;The equivalent exists for the configuration file /manager for automation.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2012 20:36:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29752#M6009</guid>
      <dc:creator>yannK</dc:creator>
      <dc:date>2012-08-08T20:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction - Separate on Colon?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29753#M6010</link>
      <description>&lt;P&gt;That's pretty neat, but I don't care about the key=value pairs in the middle, I'd rather keep that whole section intact. I just want to separate the many fields by : so I can search against them separately.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2012 20:52:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29753#M6010</guid>
      <dc:creator>holtb</dc:creator>
      <dc:date>2012-08-08T20:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction - Separate on Colon?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29754#M6011</link>
      <description>&lt;P&gt;I think I get what you are trying to do and you need to break it into phases.  Phase A gives you all 45 fields delimited with the colon, Phase B was a bit weird so field f40 is broken into two with the -l flag as the delimiter.   Phase C breaks f46 apart using a REGEX by flag type.  Finally, Phase D uses nested delims to break the f47 field into the final name/value pair.  If you try this, just run a search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="yoursourcetype" | table f* h_* mem* vir*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;props.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[yoursourcetype]
REPORT-extractions = a,b,c,d
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;transforms.conf&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[a]
DELIMS = ":"
FIELDS= f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, f16, f17, f18, f19, f20, f21, f22, f23, f24, f25, f26, f27, f28, f29, f30, f31, f32, f33, f34, f35, f36, f37, f38, f39, f40, f41, f42, f43, f44, f45

[b]
SOURCE_KEY = f40
REGEX = (.*)-l(.*)
FORMAT = f46::$1 f47::$2

[c]
SOURCE_KEY = f46
REGEX = -u (.+?) -q (.+?)$
FORMAT = f48::$1 f49::$2

[d]
SOURCE_KEY=f47
DELIMS = ",","="
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Aug 2012 21:37:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29754#M6011</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2012-08-08T21:37:10Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction - Separate on Colon?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29755#M6012</link>
      <description>&lt;P&gt;Does this answer your question?  If so, please accept.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2012 19:44:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Field-Extraction-Separate-on-Colon/m-p/29755#M6012</guid>
      <dc:creator>dmaislin_splunk</dc:creator>
      <dc:date>2012-08-09T19:44:04Z</dc:date>
    </item>
  </channel>
</rss>

