<?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 to extract pipe separated subfields from a field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-pipe-separated-subfields-from-a-field/m-p/170963#M48968</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;
I suggest you to check this document section:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Search/Parsemultivaluefields"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Search/Parsemultivaluefields&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;As you can see, I think that one simple solution could be to use "makemv" command, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=buonopasto  CMD=noop| makemv delim="|" PARAMS 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that works in the simple scenario where you just have one separator (the PIPE char). It this works for you at least in that case, you can then work on a "append" of two searches, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=buonopasto  CMD=noop| makemv delim="|" PARAMS | append [search sourcetype=buonopasto  CMD=puttrans| makemv delim=" " PARAMS ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it helps,&lt;/P&gt;

&lt;P&gt;Marco&lt;/P&gt;</description>
    <pubDate>Mon, 01 Dec 2014 10:30:50 GMT</pubDate>
    <dc:creator>marcoscala</dc:creator>
    <dc:date>2014-12-01T10:30:50Z</dc:date>
    <item>
      <title>How to extract pipe separated subfields from a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-pipe-separated-subfields-from-a-field/m-p/170960#M48965</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I have a index with a field named PARAMS.&lt;BR /&gt;
This field has a content valued by subfields pipe separated.&lt;/P&gt;

&lt;P&gt;Example:&lt;BR /&gt;
PARAMS= mySubField1|mySubField2|mysubField3|......|mySubFieldN&lt;/P&gt;

&lt;P&gt;Unfortunately Splunk doesn't correctly index this field (PARAMS) but in search app shows only the first subfield (mySubField1).&lt;BR /&gt;
Even if i try to search other subfields (mySubField2, mySubField3, etc) Splunk return nothing.&lt;/P&gt;

&lt;P&gt;Example:&lt;BR /&gt;
_raw = PARAMS= mySubField1|mySubField2|mysubField3|......|mySubFieldN&lt;BR /&gt;
but Splunk only shows mySubField1&lt;BR /&gt;
event if i try in search PARAMS=&lt;EM&gt;mySubField2&lt;/EM&gt; Splunk returns nothing.&lt;/P&gt;

&lt;P&gt;Anybody can help me please or suggest me a workaround?&lt;/P&gt;

&lt;P&gt;Thank you!&lt;BR /&gt;
Lewix&lt;/P&gt;</description>
      <pubDate>Wed, 22 Oct 2014 11:17:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-pipe-separated-subfields-from-a-field/m-p/170960#M48965</guid>
      <dc:creator>lewix</dc:creator>
      <dc:date>2014-10-22T11:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract pipe separated subfields from a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-pipe-separated-subfields-from-a-field/m-p/170961#M48966</link>
      <description>&lt;P&gt;You can create a DELIMS based extraction (transforms.conf) to extract the subfields:&lt;/P&gt;

&lt;PRE&gt;
[your\_transform\_rule]
SOURCE\_KEY = PARAMS
DELIMS = "|"
FIELDS = mysubfield1, mysubfield2, ..., mysubfieldN
&lt;/PRE&gt;

&lt;P&gt;Then, you'd call that rule from the props of your sourcetype, like this:&lt;/P&gt;

&lt;PRE&gt;
[your\_sourcetype]
REPORT-subfields = your\_transform\_rule
&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 Oct 2014 22:27:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-pipe-separated-subfields-from-a-field/m-p/170961#M48966</guid>
      <dc:creator>sowings</dc:creator>
      <dc:date>2014-10-22T22:27:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract pipe separated subfields from a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-pipe-separated-subfields-from-a-field/m-p/170962#M48967</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
thank you for your help but it seems not working.&lt;/P&gt;

&lt;P&gt;I show you what i did, maybe something is wrong&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;In /opt/splunk/etc/apps/dbx/default/transforms.conf I added these lines&lt;BR /&gt;
&lt;CODE&gt;[ethconnector_rule]&lt;BR /&gt;
SOURCE_KEY = PARAMS&lt;BR /&gt;
DELIMS = "|"&lt;BR /&gt;
FIELDS = PARAMS_FIELD1,PARAMS_FIELD2,PARAMS_FIELD3,PARAMS_FIELD4,PARAMS_FIELD5,PARAMS_FIELD6,PARAMS_FIELD7,PARAMS_FIELD8,PARAMS_FIELD9,PARAMS_FIELD10,PARAMS_FIELD11,PARAMS_FIELD12,PARAMS_FIELD13&lt;/CODE&gt;&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;In /opt/splunk/etc/apps/dbx/default/props.conf I added these lines (buonopasto is my database-input sourcetype)&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;CODE&gt;[buonopasto]&lt;BR /&gt;
REPORT-subfields = ethconnector_rule&lt;/CODE&gt;&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;I restarted splunk but new fields (PARAMS_FIELD1,...., PARAMS_FIELD12,PARAMS_FIELD13) do not appear in splunk search&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;STRONG&gt;Last info&lt;/STRONG&gt;: PARAMS, as I said before, is pipe separated in subfields, but not always. There is another field that determines how PARAMS is separated.&lt;BR /&gt;
Example:&lt;BR /&gt;
if CMD==puttrans then PARAMS=PARAMS_FIELD1|...|PARAMS_FIELD12|PARAMS_FIELD13&lt;BR /&gt;
if CMD==noop then PARAMS=field1 field2 field3&lt;/P&gt;

&lt;P&gt;Maybe can this be the issue?&lt;/P&gt;

&lt;P&gt;Thank you again.&lt;BR /&gt;
Lewix&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 18:01:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-pipe-separated-subfields-from-a-field/m-p/170962#M48967</guid>
      <dc:creator>lewix</dc:creator>
      <dc:date>2020-09-28T18:01:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to extract pipe separated subfields from a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-extract-pipe-separated-subfields-from-a-field/m-p/170963#M48968</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;
I suggest you to check this document section:&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/Search/Parsemultivaluefields"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/Search/Parsemultivaluefields&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;As you can see, I think that one simple solution could be to use "makemv" command, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=buonopasto  CMD=noop| makemv delim="|" PARAMS 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;that works in the simple scenario where you just have one separator (the PIPE char). It this works for you at least in that case, you can then work on a "append" of two searches, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=buonopasto  CMD=noop| makemv delim="|" PARAMS | append [search sourcetype=buonopasto  CMD=puttrans| makemv delim=" " PARAMS ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hope it helps,&lt;/P&gt;

&lt;P&gt;Marco&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2014 10:30:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-extract-pipe-separated-subfields-from-a-field/m-p/170963#M48968</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2014-12-01T10:30:50Z</dc:date>
    </item>
  </channel>
</rss>

