<?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 to modify hostname field and where . is there remove it in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/543045#M153829</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/193316"&gt;@surekhasplunk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Mar 2021 14:21:16 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2021-03-09T14:21:16Z</dc:date>
    <item>
      <title>rex to modify hostname field and where . is there remove it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/543022#M153820</link>
      <description>&lt;P&gt;I have index=syslog where the hostname comes as fqdn and Ip address&lt;/P&gt;&lt;P&gt;i want rex to modify only hostname field only where fqdn is coming and modify then to get only first part of the hostname all after . should be removed and save it in a new field host.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;example : hostname column has hostname which looks like abcd-efg-hij-k23-b1.xyz.gmail&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Now after using rex/sed i want in the host field abcd-efg-hij-k23-b1 everything after . should be removed.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;note: i also have ip address which has . in it so while applying rex the ip addresses should not be considered.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It should only affect/take into consideration the alphanumeric field.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 13:18:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/543022#M153820</guid>
      <dc:creator>surekhasplunk</dc:creator>
      <dc:date>2021-03-09T13:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: rex to modify hostname field and where . is there remove it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/543024#M153822</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/193316"&gt;@surekhasplunk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand: do you want a regex to extract the hostname before dot at search time or do you want to set the hostname at indextime?&lt;/P&gt;&lt;P&gt;If at searchtime, try this regex&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=host "^(?&amp;lt;host&amp;gt;[^\.]+)"&lt;/LI-CODE&gt;&lt;P&gt;if you want to replace the hostname using SEDCMD, you could try:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SEDCMD-host = y/[^\.]\.\w+\.\w+/[^\.]/&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 13:27:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/543024#M153822</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-03-09T13:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: rex to modify hostname field and where . is there remove it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/543045#M153829</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/193316"&gt;@surekhasplunk&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 14:21:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/543045#M153829</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2021-03-09T14:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: rex to modify hostname field and where . is there remove it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/548023#M155404</link>
      <description>&lt;P&gt;How to get first part before .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;example: host filed is looks like&amp;nbsp;&lt;/P&gt;&lt;P&gt;abdc.4567&lt;/P&gt;&lt;P&gt;I want only&amp;nbsp;4567&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 14:52:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/548023#M155404</guid>
      <dc:creator>sumandevops</dc:creator>
      <dc:date>2021-04-15T14:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: rex to modify hostname field and where . is there remove it</title>
      <link>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/548027#M155407</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233499"&gt;@sumandevops&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;You can use rex command;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=host "(?&amp;lt;host_no&amp;gt;\d+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 15 Apr 2021 15:21:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/rex-to-modify-hostname-field-and-where-is-there-remove-it/m-p/548027#M155407</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-04-15T15:21:05Z</dc:date>
    </item>
  </channel>
</rss>

