<?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: WEC-EventCollector add permanent field to sourcetype search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/WEC-EventCollector-add-permanent-field-to-sourcetype-search/m-p/680210#M232508</link>
    <description>&lt;P&gt;This can be done by adding a props and transforms config file on the indexer machines. As an example, you could push an app to your indexers with:&lt;/P&gt;&lt;P&gt;/&amp;lt;appname&amp;gt;/local/props.conf&lt;/P&gt;&lt;P&gt;containing:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[collectedevents]
# change_host and changehostfield are arbitrary values. Change how you like
TRANSFORMS-change_host = changehostfield&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;-and-&lt;/P&gt;&lt;P&gt;/&amp;lt;appname&amp;gt;/local/transforms.conf&lt;/P&gt;&lt;P&gt;containing:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Stanza name must match whatever you set the "changehostfield" value in props.conf
[changehostfield]
DEST_KEY = Metadata:Host
# Add your regex below
REGEX=&amp;lt;Computer&amp;gt;([^&amp;lt;]+)&amp;lt;\/Computer&amp;gt;
FORMAT = host::$1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the indexers should replace the host field with the value in the XML &amp;lt;Computer&amp;gt; field&lt;/P&gt;</description>
    <pubDate>Sun, 10 Mar 2024 19:34:48 GMT</pubDate>
    <dc:creator>marnall</dc:creator>
    <dc:date>2024-03-10T19:34:48Z</dc:date>
    <item>
      <title>WEC-EventCollector add permanent field to sourcetype search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/WEC-EventCollector-add-permanent-field-to-sourcetype-search/m-p/679839#M232388</link>
      <description>&lt;P&gt;How would I add a permanent search or field to a sourctype?&amp;nbsp;&lt;BR /&gt;For example: I have a set of a data that I have been able to snag a field out of using this search&lt;/P&gt;&lt;P&gt;sourcetype="collectedevents" | rex field=_raw "&amp;lt;Computer&amp;gt;(?&amp;lt;Computer&amp;gt;[^&amp;lt;]+)&amp;lt;/Computer&amp;gt;"&lt;BR /&gt;&lt;BR /&gt;Our sourcetype is "collectedevents"&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I found the way to pull the &amp;lt;Computer&amp;gt; field that was in the XML data down to a field "Computer"&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;But what I would like to be able to do is to have that field be permanent, or transpose the "host =" to not be the host of the WEC but the host of the origin server that it came from.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Long story short, we have servers that we don't want the Splunk Forwarder on because we know that it can execute scripts creating a vulnerability with the Splunk Forwarder on these servers.&amp;nbsp; Any help is appreciated, thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 06 Mar 2024 16:48:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/WEC-EventCollector-add-permanent-field-to-sourcetype-search/m-p/679839#M232388</guid>
      <dc:creator>zach-keener</dc:creator>
      <dc:date>2024-03-06T16:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: WEC-EventCollector add permanent field to sourcetype search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/WEC-EventCollector-add-permanent-field-to-sourcetype-search/m-p/680210#M232508</link>
      <description>&lt;P&gt;This can be done by adding a props and transforms config file on the indexer machines. As an example, you could push an app to your indexers with:&lt;/P&gt;&lt;P&gt;/&amp;lt;appname&amp;gt;/local/props.conf&lt;/P&gt;&lt;P&gt;containing:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[collectedevents]
# change_host and changehostfield are arbitrary values. Change how you like
TRANSFORMS-change_host = changehostfield&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;-and-&lt;/P&gt;&lt;P&gt;/&amp;lt;appname&amp;gt;/local/transforms.conf&lt;/P&gt;&lt;P&gt;containing:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;# Stanza name must match whatever you set the "changehostfield" value in props.conf
[changehostfield]
DEST_KEY = Metadata:Host
# Add your regex below
REGEX=&amp;lt;Computer&amp;gt;([^&amp;lt;]+)&amp;lt;\/Computer&amp;gt;
FORMAT = host::$1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then the indexers should replace the host field with the value in the XML &amp;lt;Computer&amp;gt; field&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2024 19:34:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/WEC-EventCollector-add-permanent-field-to-sourcetype-search/m-p/680210#M232508</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-03-10T19:34:48Z</dc:date>
    </item>
    <item>
      <title>Re: WEC-EventCollector add permanent field to sourcetype search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/WEC-EventCollector-add-permanent-field-to-sourcetype-search/m-p/680212#M232509</link>
      <description>&lt;P&gt;1. If you can get the events in XML into your Splunk, you can just use the default xml windows event format from TA_windows. Unfortunately it's not that easy with third party tools (there are some of them which are supposed to be able to do it but I've never tested it)&lt;/P&gt;&lt;P&gt;2. If you use WEF, why not use UF on the collector host?&lt;/P&gt;&lt;P&gt;3. Using regex on structured data is not the best idea.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Mar 2024 20:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/WEC-EventCollector-add-permanent-field-to-sourcetype-search/m-p/680212#M232509</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-03-10T20:34:37Z</dc:date>
    </item>
  </channel>
</rss>

