<?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 in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/509819#M2688</link>
    <description>&lt;LI-CODE lang="markup"&gt;index=_internal |head 1 | fields _time _raw |eval _raw="pluginText: &amp;lt;plugin_output&amp;gt; The following software are installed on the remote host :
KB3171021 [version 12.2.5000.0] [installed on 2018/06/11]
Service Pack 3 for SQL Server 2014 (KB4022619) (64-bit) [version 12.3.6024.0] [installed on 2020/06/23] KB4052725 [version 12.2.5571.0] [installed on 2018/06/11]
Veritas NetBackup Client [version 8.1.2] [installed on 2020/05/18]
Windows Policy Checker 8.0.1 SQL Server 2014 Reporting Services [version 12.3.6024.0] [installed on 2020/06/23]
Microsoft Visual Studio 2015 Shell (Minimum) [version 14.0.23107] [installed on 2019/09/11]
Microsoft Visual Studio Tools for Applications 2015 Language Support - ENU Language Pack [version 14.0.23107.20] [installed on 2019/09/11]

The following updates are installed :
Microsoft .NET Framework 4 Multi-Targeting Pack : KB2504637 [version 1] [installed on 9/11/2019]
Microsoft Visual C++ 2010 x64 Redistributable - 10.0.40219 : KB2151757 [version 1] [installed on 6/8/2018]
KB2467173 [version 1] [installed on 6/8/2018] KB2565063 [version 1] [installed on 6/8/2018] KB982573 [version 1] [installed on 6/8/2018]
Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219 : KB2151757 [version 1] [installed on 6/11/2018]
KB2467173 [version 1] [installed on 6/11/2018] KB2565063 [version 1] [installed on 6/11/2018]
&amp;lt;/plugin_output&amp;gt;"
| xmlkv
| rex mode=sed field=plugin_output "s/(?m)^.*following.*$//g"
| table plugin_output
| rex field=plugin_output max_match=0 "(?ms)(?&amp;lt;soft&amp;gt;\w.*?)\s\[version (?&amp;lt;version&amp;gt;[^\]]+)\]\s\[installed on (?&amp;lt;date&amp;gt;[^\]]+)\]"
| eval tmp=mvzip(soft,mvzip(version,date))
| stats count by tmp
| eval soft=mvindex(split(tmp,","),0), version=mvindex(split(tmp,","),1), date=mvindex(split(tmp,","),2)
| eval update=strftime(strptime(date,"%m/%d/%Y"),"%Y/%m/%d"), remote_install = if(isnotnull(update),NULL,date)
| table soft version remote_install update&lt;/LI-CODE&gt;</description>
    <pubDate>Sat, 18 Jul 2020 00:04:11 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-07-18T00:04:11Z</dc:date>
    <item>
      <title>Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/509772#M2684</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have data set that is getting ingested from the source to Splunk. Using auto extraction for, fields are extracted as they should. In this data, I have a field name &lt;STRONG&gt;pluginText&lt;/STRONG&gt;. This field contains a lot of information e.g. software installed on endpoints, updates installed etc. I need to extract this information from this field. Sample is below. What is the best approach? I need both from configuring field extraction for this in configs or in actual Splunk search using rex or eval.&lt;/P&gt;&lt;P&gt;pluginText: &amp;lt;plugin_output&amp;gt; The following software are installed on the remote host :&lt;BR /&gt;KB3171021 [version 12.2.5000.0] [installed on 2018/06/11]&lt;BR /&gt;Service Pack 3 for SQL Server 2014 (KB4022619) (64-bit) [version 12.3.6024.0] [installed on 2020/06/23] KB4052725 [version 12.2.5571.0] [installed on 2018/06/11]&lt;BR /&gt;Veritas NetBackup Client [version 8.1.2] [installed on 2020/05/18]&lt;BR /&gt;Windows Policy Checker 8.0.1 SQL Server 2014 Reporting Services [version 12.3.6024.0] [installed on 2020/06/23]&lt;BR /&gt;Microsoft Visual Studio 2015 Shell (Minimum) [version 14.0.23107] [installed on 2019/09/11]&lt;BR /&gt;Microsoft Visual Studio Tools for Applications 2015 Language Support - ENU Language Pack [version 14.0.23107.20] [installed on 2019/09/11]&lt;/P&gt;&lt;P&gt;The following updates are installed :&lt;BR /&gt;Microsoft .NET Framework 4 Multi-Targeting Pack : KB2504637 [version 1] [installed on 9/11/2019]&lt;BR /&gt;Microsoft Visual C++ 2010 x64 Redistributable - 10.0.40219 : KB2151757 [version 1] [installed on 6/8/2018]&lt;BR /&gt;KB2467173 [version 1] [installed on 6/8/2018] KB2565063 [version 1] [installed on 6/8/2018] KB982573 [version 1] [installed on 6/8/2018]&lt;BR /&gt;Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219 : KB2151757 [version 1] [installed on 6/11/2018]&lt;BR /&gt;KB2467173 [version 1] [installed on 6/11/2018] KB2565063 [version 1] [installed on 6/11/2018]&lt;BR /&gt;&amp;lt;/plugin_output&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in-advance!!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 18:38:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/509772#M2684</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-07-17T18:38:03Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/509799#M2687</link>
      <description>&lt;P&gt;This is a bit of a hack, but it will do the extractions at search time.&amp;nbsp; Index-time extraction is left as a exercise for the reader.&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval pluginText="&amp;lt;plugin_output&amp;gt; The following software are installed on the remote host :
KB3171021 [version 12.2.5000.0] [installed on 2018/06/11]
Service Pack 3 for SQL Server 2014 (KB4022619) (64-bit) [version 12.3.6024.0] [installed on 2020/06/23] KB4052725 [version 12.2.5571.0] [installed on 2018/06/11]
Veritas NetBackup Client [version 8.1.2] [installed on 2020/05/18]
Windows Policy Checker 8.0.1 SQL Server 2014 Reporting Services [version 12.3.6024.0] [installed on 2020/06/23]
Microsoft Visual Studio 2015 Shell (Minimum) [version 14.0.23107] [installed on 2019/09/11]
Microsoft Visual Studio Tools for Applications 2015 Language Support - ENU Language Pack [version 14.0.23107.20] [installed on 2019/09/11]

The following updates are installed :
Microsoft .NET Framework 4 Multi-Targeting Pack : KB2504637 [version 1] [installed on 9/11/2019]
Microsoft Visual C++ 2010 x64 Redistributable - 10.0.40219 : KB2151757 [version 1] [installed on 6/8/2018]
KB2467173 [version 1] [installed on 6/8/2018] KB2565063 [version 1] [installed on 6/8/2018] KB982573 [version 1] [installed on 6/8/2018]
Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219 : KB2151757 [version 1] [installed on 6/11/2018]
KB2467173 [version 1] [installed on 6/11/2018] KB2565063 [version 1] [installed on 6/11/2018]
&amp;lt;/plugin_output&amp;gt;" 
``` Above just creates text data"```
```Start by stripping out text that is not a plugin```
| rex mode=sed field=pluginText "s/\&amp;lt;plugin_output&amp;gt;.*\s:\n//"
| rex mode=sed field=pluginText "s/The following updates are installed\s://"
| rex mode=sed field=pluginText "s/\&amp;lt;\/plugin_output&amp;gt;//"
| rex mode=sed field=pluginText "s/\n{2,}//g"
| rex field=pluginText "(?&amp;lt;software&amp;gt;[\s\S]+)"
```Now parse the plugin parts into fields```
| rex field=software max_match=0 "(?&amp;lt;package&amp;gt;[^\[]+) \[version\s(?&amp;lt;version&amp;gt;[^\]]+)] \[installed on (?&amp;lt;installedOn&amp;gt;[^\]]+)]\s*"
`` Assemble the 3 multi-value fields into a single multi-value field then expand the result into separate events and break the events up again```
| eval packages = mvzip(package,mvzip(version, installedOn)) | mvexpand packages | eval packages=split(packages,",") 
```Pull the individual fields out of the multi-value field
| eval package=mvindex(packages,0), version=mvindex(packages,1), installedOn=mvindex(packages,2)
| table package, version, installedOn&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 17 Jul 2020 21:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/509799#M2687</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-07-17T21:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/509819#M2688</link>
      <description>&lt;LI-CODE lang="markup"&gt;index=_internal |head 1 | fields _time _raw |eval _raw="pluginText: &amp;lt;plugin_output&amp;gt; The following software are installed on the remote host :
KB3171021 [version 12.2.5000.0] [installed on 2018/06/11]
Service Pack 3 for SQL Server 2014 (KB4022619) (64-bit) [version 12.3.6024.0] [installed on 2020/06/23] KB4052725 [version 12.2.5571.0] [installed on 2018/06/11]
Veritas NetBackup Client [version 8.1.2] [installed on 2020/05/18]
Windows Policy Checker 8.0.1 SQL Server 2014 Reporting Services [version 12.3.6024.0] [installed on 2020/06/23]
Microsoft Visual Studio 2015 Shell (Minimum) [version 14.0.23107] [installed on 2019/09/11]
Microsoft Visual Studio Tools for Applications 2015 Language Support - ENU Language Pack [version 14.0.23107.20] [installed on 2019/09/11]

The following updates are installed :
Microsoft .NET Framework 4 Multi-Targeting Pack : KB2504637 [version 1] [installed on 9/11/2019]
Microsoft Visual C++ 2010 x64 Redistributable - 10.0.40219 : KB2151757 [version 1] [installed on 6/8/2018]
KB2467173 [version 1] [installed on 6/8/2018] KB2565063 [version 1] [installed on 6/8/2018] KB982573 [version 1] [installed on 6/8/2018]
Microsoft Visual C++ 2010 x86 Redistributable - 10.0.40219 : KB2151757 [version 1] [installed on 6/11/2018]
KB2467173 [version 1] [installed on 6/11/2018] KB2565063 [version 1] [installed on 6/11/2018]
&amp;lt;/plugin_output&amp;gt;"
| xmlkv
| rex mode=sed field=plugin_output "s/(?m)^.*following.*$//g"
| table plugin_output
| rex field=plugin_output max_match=0 "(?ms)(?&amp;lt;soft&amp;gt;\w.*?)\s\[version (?&amp;lt;version&amp;gt;[^\]]+)\]\s\[installed on (?&amp;lt;date&amp;gt;[^\]]+)\]"
| eval tmp=mvzip(soft,mvzip(version,date))
| stats count by tmp
| eval soft=mvindex(split(tmp,","),0), version=mvindex(split(tmp,","),1), date=mvindex(split(tmp,","),2)
| eval update=strftime(strptime(date,"%m/%d/%Y"),"%Y/%m/%d"), remote_install = if(isnotnull(update),NULL,date)
| table soft version remote_install update&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 18 Jul 2020 00:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/509819#M2688</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-07-18T00:04:11Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/510100#M2725</link>
      <description>&lt;P&gt;I am looking into both responses and doing validations at my end. Will get back with you shortly. Just wanted to let you all know how much I appreciate your assistance ...... always!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 19:11:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/510100#M2725</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-07-20T19:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/512594#M2968</link>
      <description>&lt;P&gt;Have been doing some validations and adjustments so apology for delay. I ended up using t4kawa's solution. Rich's solution is also good and I want to up-vote that but don't see an option in Splunk community.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Aug 2020 15:06:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/512594#M2968</guid>
      <dc:creator>mbasharat</dc:creator>
      <dc:date>2020-08-05T15:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Field Extraction</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/512611#M2970</link>
      <description>Click the "thumbs-up" icon to up-vote a posting in this new forum.</description>
      <pubDate>Wed, 05 Aug 2020 15:58:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/Field-Extraction/m-p/512611#M2970</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-08-05T15:58:53Z</dc:date>
    </item>
  </channel>
</rss>

