<?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: Get the network server names from the _raw events in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149098#M41658</link>
    <description>&lt;P&gt;That worked like a charm. Could you please explain the rex you provided? i have more scenarios like this and can't figure out how it's getting to the host.&lt;/P&gt;</description>
    <pubDate>Wed, 21 May 2014 15:07:20 GMT</pubDate>
    <dc:creator>Raghav2384</dc:creator>
    <dc:date>2014-05-21T15:07:20Z</dc:date>
    <item>
      <title>Get the network server names from the _raw events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149095#M41655</link>
      <description>&lt;P&gt;Hello Again,&lt;BR /&gt;
We have an index = network which isn't setup at host level so, we do not have accuracy using hosts field. I have to look in the events and get the list from it :(. This is what the events look like&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;event 1&lt;/STRONG&gt;: &lt;EM&gt;May 1 10:20:37 3.9.128.37 May 1 14:24:50 **slot1/ISSvsXUSalpdc01a&lt;/EM&gt;* debug apd[9979]: 01490024:7: a24c56dc: LDAP module: LEAVE Function queryLDAP*.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;event 2:&lt;/STRONG&gt; &lt;EM&gt;Apr 30 06:59:36 **xbtssyslog1.ae.xy.com&lt;/EM&gt;* EOGfeEGBwalke01 Apr 30 2014 06:59:36 EOGfeEGBwalke01 : %ASA-5-304001: 10.168.3.11 Accessed URL ##12.30.128.137:ww.theminiforum.xx.xy/&lt;/P&gt;

&lt;P&gt;So, it's pretty much the third word i need from every log event(This example: &lt;STRONG&gt;"slot1/ISSvsXUSalpdc01a"&lt;/STRONG&gt; &amp;amp; &lt;STRONG&gt;"xbtssyslog1.ae.xy.com"&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I tried delim="" to see if it splits(no luck). Please advice.&lt;BR /&gt;
Thanks in advance.&lt;BR /&gt;
Raghav&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:30:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149095#M41655</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2020-09-28T16:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: Get the network server names from the _raw events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149096#M41656</link>
      <description>&lt;P&gt;First, I would get the indexing fixed. There are many ways to set the host field on inbound data - inputs.conf, props.conf and transforms.conf.&lt;/P&gt;

&lt;P&gt;But to get the host field out of already indexed data,  you could do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=network 
| rex "(?:^.*?\d{2}:\d{2}:\d{2}.*?\d{2}:\d{2}:\d{2}|^.*?\d{2}:\d{2}:\d{2})\s(?&amp;lt;hostname&amp;gt;\S+)\s"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am not entirely sure that this will work - it is a fairly complex regular expression. I named the resulting field &lt;CODE&gt;hostname&lt;/CODE&gt; to distinguish it from the default &lt;CODE&gt;host&lt;/CODE&gt; field.&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2014 17:16:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149096#M41656</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-05-01T17:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: Get the network server names from the _raw events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149097#M41657</link>
      <description>&lt;P&gt;The key is to find commonalities among your events and then write a regex that extracts the desired data from them.  I see no such commonalities in your examples.  The host names are the 8th and 4th words, respectively, so word count doesn't work.  Nor do I see any other anchor that can be used to find the host name in each event.  Perhaps you can use source or sourcetype to determine which of several regex's to apply to the associated event.&lt;/P&gt;

&lt;P&gt;A better approach would be to parse the events as they are indexed so the fields are available at search time.&lt;/P&gt;</description>
      <pubDate>Thu, 01 May 2014 17:24:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149097#M41657</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2014-05-01T17:24:45Z</dc:date>
    </item>
    <item>
      <title>Re: Get the network server names from the _raw events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149098#M41658</link>
      <description>&lt;P&gt;That worked like a charm. Could you please explain the rex you provided? i have more scenarios like this and can't figure out how it's getting to the host.&lt;/P&gt;</description>
      <pubDate>Wed, 21 May 2014 15:07:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149098#M41658</guid>
      <dc:creator>Raghav2384</dc:creator>
      <dc:date>2014-05-21T15:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Get the network server names from the _raw events</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149099#M41659</link>
      <description>&lt;P&gt;It's a bit complicated. I'll try, but I suggest "Teach Yourself Regular Expressions in 10 Minutes" or &lt;A href="http://regular-expressions.info"&gt;http://regular-expressions.info&lt;/A&gt; or any old Perl book you might have around.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;EITHER dd:dd:dd anything dd:dd:dd 
OR anything dd:dd:dd
FOLLOWED BY the field hostname, which is a string of characters, terminated by whitespace
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 May 2014 18:44:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Get-the-network-server-names-from-the-raw-events/m-p/149099#M41659</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-05-21T18:44:22Z</dc:date>
    </item>
  </channel>
</rss>

