<?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 expression for multiple extractions in columns in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310468#M93105</link>
    <description>&lt;P&gt;No unfortunately this is not csv, (or structured data), essentially this is a large text file, and this data is in tabular format somewhere towards the middle of the file, the easiest way to look at it was if we ran an "ls  -t" on a unix server with the headers being at the top, and yes it is in splunk as an event.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Apr 2017 22:06:59 GMT</pubDate>
    <dc:creator>raby1996</dc:creator>
    <dc:date>2017-04-04T22:06:59Z</dc:date>
    <item>
      <title>REX expression for multiple extractions in columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310466#M93103</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;I was hoping I could get a bit of assistance in figuring out a rex expression I could use to extract part numbers that are in column, I have a sample data set below,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;part_num      serial_num         type
abc            123                a
bcd            234                a
cde            456                b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Essentially I'm trying to extract all the "part_num" and "serial_num" for "types" of "a", I can extract the first part that matches however I've been unable to figure out how I can extract all fields I need of type a for my events, essentially it would look like this (FYI, I already have the host machine serial number extracted)&lt;/P&gt;

&lt;P&gt;rex....&lt;BR /&gt;
|stats list(part_num) as part_num list(serial_num) as serial_num by host_machine&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;host_machine.      part_num             serial_num
981-aabbc             abc                    123
                      bcd                    234
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and this would display for all my machines. Thank you, and please let me know if there are any questions, I appreciate any help&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:32:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310466#M93103</guid>
      <dc:creator>raby1996</dc:creator>
      <dc:date>2020-09-29T13:32:23Z</dc:date>
    </item>
    <item>
      <title>Re: REX expression for multiple extractions in columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310467#M93104</link>
      <description>&lt;P&gt;Your sample data set looks like a CSV file. Is it?&lt;/P&gt;

&lt;P&gt;If it is, then wouldn't you want to do a lookup by type to get the part_num and serial_num from the lookup table? That would not require a rex statement at all. &lt;/P&gt;

&lt;P&gt;If not, what exactly is the sample data set? And is it in Splunk as an event, or what?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:32:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310467#M93104</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2020-09-29T13:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: REX expression for multiple extractions in columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310468#M93105</link>
      <description>&lt;P&gt;No unfortunately this is not csv, (or structured data), essentially this is a large text file, and this data is in tabular format somewhere towards the middle of the file, the easiest way to look at it was if we ran an "ls  -t" on a unix server with the headers being at the top, and yes it is in splunk as an event.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 22:06:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310468#M93105</guid>
      <dc:creator>raby1996</dc:creator>
      <dc:date>2017-04-04T22:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: REX expression for multiple extractions in columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310469#M93106</link>
      <description>&lt;P&gt;Is your "dataset" above a single event that looks &lt;EM&gt;exactly&lt;/EM&gt; like that?&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 22:14:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310469#M93106</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-04T22:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: REX expression for multiple extractions in columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310470#M93107</link>
      <description>&lt;P&gt;If your "dataset" above a single event that looks exactly like that, then you need &lt;CODE&gt;multikv&lt;/CODE&gt;:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Multikv"&gt;http://docs.splunk.com/Documentation/Splunk/6.5.2/SearchReference/Multikv&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2017 22:16:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310470#M93107</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-04-04T22:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: REX expression for multiple extractions in columns</title>
      <link>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310471#M93108</link>
      <description>&lt;P&gt;Yes, your'e right, this looks like it will do the job, thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Apr 2017 19:40:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/REX-expression-for-multiple-extractions-in-columns/m-p/310471#M93108</guid>
      <dc:creator>raby1996</dc:creator>
      <dc:date>2017-04-05T19:40:39Z</dc:date>
    </item>
  </channel>
</rss>

