<?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: Extracting multiple fields from comma separated log in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-comma-separated-log/m-p/363083#M161193</link>
    <description>&lt;P&gt;Assuming that any one of the fills could have values, but non having an embedded comma, this should work to get your three fields:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_your_search_ | rex "^([^,]*?,){11}(?P&amp;lt;a&amp;gt;[^,]+),(?P&amp;lt;b&amp;gt;[^,]*),([^,]*?,){4}(?P&amp;lt;c&amp;gt;[^,]+)," | table c, a, b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try this out and see if you get the fields the way you want them. It worked for me with the one line example data you included. I don't know what your table headings would be, so I just used &lt;STRONG&gt;a&lt;/STRONG&gt;, &lt;STRONG&gt;b&lt;/STRONG&gt; and &lt;STRONG&gt;c&lt;/STRONG&gt;. You can change that for your search.&lt;/P&gt;</description>
    <pubDate>Fri, 05 May 2017 01:18:50 GMT</pubDate>
    <dc:creator>cpetterborg</dc:creator>
    <dc:date>2017-05-05T01:18:50Z</dc:date>
    <item>
      <title>Extracting multiple fields from comma separated log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-comma-separated-log/m-p/363082#M161192</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;Can someone help me to build a table report by extracting 3 fields from a comma separated log:&lt;/P&gt;

&lt;P&gt;Here's a log example:&lt;/P&gt;

&lt;P&gt;2017-05-03 13:30:36 User.Error  10.40.11.241    2017-05-03 17:30:35,987, , audit.runtime.com.rsa.authmgr.internal.protocol.ace.AuthV4RequestHandler, ERROR, eec1c356f110280a7888f02ad5a2b3e9,1336c44ff110280a0801a35a997a135e,10.40.11.11,10.40.16.241,AUTH_PRINCIPAL_RESOLUTION,23008,FAIL,AUTH_RESOLUTION_FAILED_BY_ID_ALIAS,,,,,ptr555,,,1c0931660610330a1a1eb51b527f5700,000000000000000000001000e0011000,10.40.18.73,njx-domain..net,1,,,,,,,1,,,,,,,,&lt;/P&gt;

&lt;P&gt;desired result would be a table with a result:&lt;/P&gt;

&lt;P&gt;ptr555|FAIL|AUTH_RESOLUTION_FAILED_BY_ID_ALIAS&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:57:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-comma-separated-log/m-p/363082#M161192</guid>
      <dc:creator>ptur</dc:creator>
      <dc:date>2020-09-29T13:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: Extracting multiple fields from comma separated log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-comma-separated-log/m-p/363083#M161193</link>
      <description>&lt;P&gt;Assuming that any one of the fills could have values, but non having an embedded comma, this should work to get your three fields:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_your_search_ | rex "^([^,]*?,){11}(?P&amp;lt;a&amp;gt;[^,]+),(?P&amp;lt;b&amp;gt;[^,]*),([^,]*?,){4}(?P&amp;lt;c&amp;gt;[^,]+)," | table c, a, b
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try this out and see if you get the fields the way you want them. It worked for me with the one line example data you included. I don't know what your table headings would be, so I just used &lt;STRONG&gt;a&lt;/STRONG&gt;, &lt;STRONG&gt;b&lt;/STRONG&gt; and &lt;STRONG&gt;c&lt;/STRONG&gt;. You can change that for your search.&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2017 01:18:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Extracting-multiple-fields-from-comma-separated-log/m-p/363083#M161193</guid>
      <dc:creator>cpetterborg</dc:creator>
      <dc:date>2017-05-05T01:18:50Z</dc:date>
    </item>
  </channel>
</rss>

