<?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 we can add the hostname in event itself in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520111#M3468</link>
    <description>&lt;P&gt;Note: The below change will add Hostname to events when event matches "xx:xx:xx&amp;nbsp;anyword:"&lt;BR /&gt;for example below regex matches below bold characters&lt;/P&gt;&lt;P&gt;2020 Sep 15 &lt;STRONG&gt;09:23:05 UTC:&lt;/STRONG&gt; Hostname %DAEMON-3-SYSTEM_MSG: error: PAM: Authentication failure for illegal user user1 from 10.1.1.1 - sshd[16425]&lt;BR /&gt;2020 Sep 15 &lt;STRONG&gt;09:23:04 UTC:&lt;/STRONG&gt; Hostname %AUTHPRIV-3-SYSTEM_MSG: pam_aaa:Authentication failed for user user2 from 10.1.1.1 - sshd[16427]&lt;/P&gt;&lt;P&gt;props.conf ( replace Hostname below with your actual Hostname and yoursourcetype with sourcetype for which you want to add Hostname when regex matches)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[yoursourcetype]
SEDCMD-addhostname=s/(.*\d+:\d+:\d+\s+\w+\:)(.*)/\1 Hostname \2/g&lt;/LI-CODE&gt;&lt;P&gt;output:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2020 Sep 15 09:23:05 UTC: Hostname  %DAEMON-3-SYSTEM_MSG: error: PAM: Authentication failure for illegal user user1 from 10.1.1.1 - sshd[16425]
2020 Sep 15 09:23:04 UTC: Hostname  %AUTHPRIV-3-SYSTEM_MSG: pam_aaa:Authentication failed for user user2 from 10.1.1.1 - sshd[16427]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Sep 2020 11:26:09 GMT</pubDate>
    <dc:creator>thambisetty</dc:creator>
    <dc:date>2020-09-17T11:26:09Z</dc:date>
    <item>
      <title>How can we add the hostname in an event itself?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520063#M3459</link>
      <description>&lt;P&gt;Hi, I want to rewrite the event based on some keyword in event.&lt;/P&gt;
&lt;P&gt;For Example:&lt;/P&gt;
&lt;P&gt;Junly 27 10:00:05 UTC IF_DOWN SYSLOG_DAEMON&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if i match SYSLOG from the event and add field in event on Heavy forwarder to send the logs to res pective destination.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;New Log Event:&lt;/P&gt;
&lt;P&gt;July 27 Hostname 10:00:0006 IF_DOWN SYSLOG_DAEMON&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can we do on heavyforward by using transoform.conf or props.conf ?/&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kindly help&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 22:54:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520063#M3459</guid>
      <dc:creator>pankajupadhyay</dc:creator>
      <dc:date>2020-09-18T22:54:03Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520076#M3461</link>
      <description>&lt;P&gt;&lt;SPAN&gt;So if i match SYSLOG from the event and add field in event on Heavy forwarder to send the logs to res pective destination.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;you want to add Hostname in event and forward to respective destination ( you mean different Indexer?)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;adding Hostname to all events transforming all events to new event. This is CPU intensive.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;share more details to give you better solution.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 08:27:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520076#M3461</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-17T08:27:53Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520088#M3464</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp; Yes you have understood correct.&lt;/P&gt;&lt;P&gt;We need to add hostname in the event based on some keyword and then forward it Indexer and third party SIEM tool.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help me with the method and solution.&lt;/P&gt;&lt;P&gt;flow would be "&lt;/P&gt;&lt;P&gt;Logs source &amp;gt;&amp;gt;&amp;gt;&amp;gt; HF&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt; Indexer and third party collector.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 09:35:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520088#M3464</guid>
      <dc:creator>pankajupadhyay</dc:creator>
      <dc:date>2020-09-17T09:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520097#M3465</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;There are two log sources which does not append the hostname in a log even when it forward to HF.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So We are looking to achive with splunk HF and then forward to indexer and third party SIEM to categorize properly.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 10:37:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520097#M3465</guid>
      <dc:creator>pankajupadhyay</dc:creator>
      <dc:date>2020-09-17T10:37:54Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520099#M3466</link>
      <description>&lt;P&gt;share one complete sample event for which you want to add hostname.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 10:42:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520099#M3466</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-17T10:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520102#M3467</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi Please find the below sample logs event&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2020 Sep 15 09:23:05 UTC: %DAEMON-3-SYSTEM_MSG: error: PAM: Authentication failure for illegal user user1 from 10.1.1.1 - sshd[16425]&lt;/P&gt;&lt;P&gt;2020 Sep 15 09:23:04 UTC: %AUTHPRIV-3-SYSTEM_MSG: pam_aaa:Authentication failed for user user2 from 10.1.1.1 - sshd[16427]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 10:52:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520102#M3467</guid>
      <dc:creator>pankajupadhyay</dc:creator>
      <dc:date>2020-09-17T10:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520111#M3468</link>
      <description>&lt;P&gt;Note: The below change will add Hostname to events when event matches "xx:xx:xx&amp;nbsp;anyword:"&lt;BR /&gt;for example below regex matches below bold characters&lt;/P&gt;&lt;P&gt;2020 Sep 15 &lt;STRONG&gt;09:23:05 UTC:&lt;/STRONG&gt; Hostname %DAEMON-3-SYSTEM_MSG: error: PAM: Authentication failure for illegal user user1 from 10.1.1.1 - sshd[16425]&lt;BR /&gt;2020 Sep 15 &lt;STRONG&gt;09:23:04 UTC:&lt;/STRONG&gt; Hostname %AUTHPRIV-3-SYSTEM_MSG: pam_aaa:Authentication failed for user user2 from 10.1.1.1 - sshd[16427]&lt;/P&gt;&lt;P&gt;props.conf ( replace Hostname below with your actual Hostname and yoursourcetype with sourcetype for which you want to add Hostname when regex matches)&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[yoursourcetype]
SEDCMD-addhostname=s/(.*\d+:\d+:\d+\s+\w+\:)(.*)/\1 Hostname \2/g&lt;/LI-CODE&gt;&lt;P&gt;output:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;2020 Sep 15 09:23:05 UTC: Hostname  %DAEMON-3-SYSTEM_MSG: error: PAM: Authentication failure for illegal user user1 from 10.1.1.1 - sshd[16425]
2020 Sep 15 09:23:04 UTC: Hostname  %AUTHPRIV-3-SYSTEM_MSG: pam_aaa:Authentication failed for user user2 from 10.1.1.1 - sshd[16427]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 11:26:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520111#M3468</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-17T11:26:09Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520139#M3471</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp; Thanks for sharing the information.&lt;/P&gt;&lt;P&gt;We have used the SEDCMD for this sourcetype to remove the unwanted event&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regex:&lt;/P&gt;&lt;P&gt;SEDCMD-remove3 = s/^(?P&amp;lt;cisco&amp;gt;\w+\s+\d+\s+\d+:\d+:\d+\s+\d+\.\d+\.\d+\.\d+\s+\d+:)//g&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can we use both SEDCMD for same sourcetype. or we can this to achieve the same result which you have shown in output&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 13:42:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520139#M3471</guid>
      <dc:creator>pankajupadhyay</dc:creator>
      <dc:date>2020-09-17T13:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520143#M3472</link>
      <description>&lt;P&gt;yes, you can use. if the regex is going to concentrate on similar events.&lt;/P&gt;&lt;P&gt;For example : you have different type of events in single sourcetype. if you want to add hostname for one type of event and you want to remove extra line for different event then you cant.&amp;nbsp; you should have two SEDCMD-classes&lt;/P&gt;</description>
      <pubDate>Thu, 17 Sep 2020 13:48:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520143#M3472</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-17T13:48:03Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520156#M3474</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have used this.&lt;/P&gt;&lt;P&gt;[sourcety]&lt;/P&gt;&lt;P&gt;SEDCMD-addhostname = s/^(?P&amp;lt;ffff&amp;gt;\w+\s+\d+\s+\d+:\d+:\d+\s+\d+\.\d+\.\d+\.\d+\s+:)/\1 hostname1 \2/g&lt;/P&gt;&lt;P&gt;Outputs of above props.conf&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sep 17 16:40:40 10.1.1.2&lt;/STRONG&gt;&amp;nbsp;: hostname&amp;nbsp;&lt;FONT color="#333333"&gt;&lt;U&gt;2020 Sep 17 14:55:51.485 utc: %DAEMON-3-SYSTEM_MSG: error: PAM: Authentication failure for illegal user jhsfhefje from 10.1.1.1- sshd[3475]&lt;/U&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want highlighted section as a output.&lt;/P&gt;&lt;P&gt;But Bold highlighted section need to be delete from log events but it is not happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you please help me where i am wrong in that.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 09:01:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520156#M3474</guid>
      <dc:creator>pankajupadhyay</dc:creator>
      <dc:date>2020-09-18T09:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520261#M3480</link>
      <description>&lt;P&gt;I believe below is your actual event:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Sep 17 16:40:40 10.81.194.72 :&lt;/STRONG&gt; 2020 Sep 17 14:55:51.485 utc: %DAEMON-3-SYSTEM_MSG: error: PAM: Authentication failure for illegal user jhsfhefje from 10.1.1.1- sshd[3475]&lt;/P&gt;&lt;P&gt;and text in bold needs to be removed and hostname needs to be appended after utc:&amp;nbsp;&lt;/P&gt;&lt;P&gt;use below regex to do above said actions:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;s/^\w+\s+\d+\s+\d+:\d+:\d+\s+\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\s+\:\s+(.*\d+:\d+:\d+\.\d+\s+\w+\:)(.*)/\1 hostname\2/g&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;output:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;2020 Sep 17 14:55:51.485 utc: &lt;STRONG&gt;hostname&lt;/STRONG&gt; %DAEMON-3-SYSTEM_MSG: error: PAM: Authentication failure for illegal user jhsfhefje from 10.1.1.1- sshd[3475]&lt;/P&gt;&lt;P&gt;you can see demo using below Link:&lt;/P&gt;&lt;P&gt;&lt;A href="https://regex101.com/r/UylKiP/1" target="_blank"&gt;https://regex101.com/r/UylKiP/1&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 08:01:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520261#M3480</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-18T08:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520279#M3483</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/129407"&gt;@thambisetty&lt;/a&gt;&amp;nbsp; Yeah thanks for your support.&lt;/P&gt;&lt;P&gt;I got the detail but can you please let me know the Regex which i have shared here where i was wrong.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 08:59:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520279#M3483</guid>
      <dc:creator>pankajupadhyay</dc:creator>
      <dc:date>2020-09-18T08:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: How we can add the hostname in event itself</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520282#M3484</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/206557"&gt;@pankajupadhyay&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;break your regex and keep verifying one by one character, you will understand where your regex has problem.&lt;/P&gt;&lt;P&gt;use &lt;A href="https://regex101.com" target="_blank"&gt;https://regex101.com&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 18 Sep 2020 09:04:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-can-we-add-the-hostname-in-an-event-itself/m-p/520282#M3484</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2020-09-18T09:04:10Z</dc:date>
    </item>
  </channel>
</rss>

