< Return to Video

Using a Lookup Table in Splunk

  • 0:02 - 0:04
    Hi, Travis with Splunk here.
  • 0:04 - 0:06
    In this video, I want to go over look up
  • 0:06 - 0:09
    tables and give you an example of how I
  • 0:09 - 0:11
    use lookup tables.
  • 0:11 - 0:15
    I've pulled up a search here that shows
  • 0:15 - 0:17
    the you know activity of the different
  • 0:17 - 0:19
    devices on my home network.
  • 0:19 - 0:22
    I can see there is a spike in data and
  • 0:22 - 0:25
    instead of me having to remember you
  • 0:25 - 0:27
    know the IP address
  • 0:27 - 0:30
    of that device. I can have a lookup table
  • 0:30 - 0:33
    translate that IP to a host name so that
  • 0:33 - 0:36
    when I hover over this Spike of data
  • 0:36 - 0:38
    you know I get a name instead of an IP
  • 0:38 - 0:39
    address,
  • 0:39 - 0:41
    and this is very helpful because I don't
  • 0:41 - 0:42
    want to remember all the IP addresses
  • 0:42 - 0:46
    for all the 30 plus devices that are you
  • 0:46 - 0:48
    know in my house or in my home
  • 0:48 - 0:51
    environment.
  • 0:51 - 0:53
    So if you're new to Splunk or you're
  • 0:53 - 0:54
    sitting here going look up tables. Why
  • 0:54 - 0:56
    are they important? What are you talking
  • 0:56 - 0:59
    about, Travis? Let's go to your favorite
  • 0:59 - 1:02
    search engine, whatever you want to use,
  • 1:02 - 1:06
    and do a search on Splunk lookup tables;
  • 1:06 - 1:08
    give you ways to find more information
  • 1:08 - 1:11
    and use our documentation. I find. you
  • 1:11 - 1:13
    know, doing a search in your favorite
  • 1:13 - 1:15
    search engine
  • 1:15 - 1:17
    is the easiest way to find stuff in our
  • 1:17 - 1:20
    documentation. So the first result is a
  • 1:20 - 1:23
    lookup command,
  • 1:23 - 1:25
    I am using that lookup command in
  • 1:25 - 1:26
    this search,
  • 1:26 - 1:28
    and then if we go back here the second
  • 1:28 - 1:31
    one is about lookups, and then there's
  • 1:31 - 1:34
    other, you know, lookup command examples
  • 1:34 - 1:36
    there is you know how to use lookup
  • 1:36 - 1:39
    table the, you know, Splunk Community.
  • 1:39 - 1:41
    Splunk answers, but I'm going to go into
  • 1:41 - 1:44
    this about lookups, Splunk documentation
  • 1:44 - 1:46
    and show you more information about the
  • 1:46 - 1:48
    lookup table
  • 1:48 - 1:50
    here, you know what is a lookup way to
  • 1:50 - 1:53
    enrich your data that you are collecting
  • 1:53 - 1:56
    you know the four types of lookup CSV
  • 1:56 - 2:00
    external KV store and even Geo,
  • 2:00 - 2:03
    and then how you know more information
  • 2:03 - 2:05
    about each one of those four types of
  • 2:05 - 2:08
    lookup tables. I'm going to focus on CSV
  • 2:08 - 2:10
    today,
  • 2:10 - 2:13
    and here we have a link to you know how
  • 2:13 - 2:16
    can I create and bring a lookup table
  • 2:16 - 2:19
    into Splunk using the the web GUI or if
  • 2:19 - 2:20
    you like,
  • 2:20 - 2:21
    you know, using the configuration file
  • 2:21 - 2:24
    CLI you know there's a link for that, but
  • 2:24 - 2:27
    for today, we are going to go into
  • 2:27 - 2:30
    this link here which defines a CSV
  • 2:30 - 2:33
    lookup gives you more information about
  • 2:33 - 2:36
    that CSV file, and then how to upload
  • 2:36 - 2:38
    that file. And if you need an example of
  • 2:38 - 2:42
    a lookup table, you know, we have see look
  • 2:42 - 2:44
    up for an example you know this lookup
  • 2:44 - 2:46
    is a hyperlink,
  • 2:46 - 2:49
    and we can drill down even further and
  • 2:49 - 2:51
    see examples of a lookup table.
  • 2:51 - 2:54
    An example that we provide is a HTTP
  • 2:54 - 2:58
    status code I say we Splunk,
  • 2:58 - 3:00
    and you can go ahead and download that
  • 3:00 - 3:02
    so you can see it or just review the
  • 3:02 - 3:05
    sample that Splunk has provided. Where it
  • 3:05 - 3:08
    shows the header field, you know, status
  • 3:08 - 3:10
    comma status description comma status
  • 3:10 - 3:12
    type
  • 3:12 - 3:14
    and then values that are associated with
  • 3:14 - 3:16
    the header field and it's all comma
  • 3:16 - 3:19
    separated and no spaces.
  • 3:19 - 3:21
    So you can see like 200 okay. And
  • 3:21 - 3:24
    successful and you know three different
  • 3:24 - 3:26
    header fields,
  • 3:26 - 3:29
    and then the steps two
  • 3:29 - 3:31
    go ahead and
  • 3:31 - 3:34
    uh add those lookup tables into your
  • 3:34 - 3:36
    Splunk web.
  • 3:37 - 3:40
    So let's take one step back here,
  • 3:40 - 3:42
    you know, in here, you know more
  • 3:42 - 3:44
    information about lookup tables and how
  • 3:44 - 3:46
    to get that in there.
  • 3:46 - 3:49
    So just take some time and go through
  • 3:49 - 3:50
    all of this,
  • 3:50 - 3:51
    you know, I could probably spend an hour
  • 3:51 - 3:54
    on lookup tables,
  • 3:54 - 3:56
    but what I'm going to do is also you
  • 3:56 - 3:57
    know scroll down here because there's
  • 3:57 - 3:59
    something else I want to show. This is
  • 3:59 - 4:02
    back to the about lookups and if I
  • 4:02 - 4:04
    scroll down you know more lookup table
  • 4:04 - 4:06
    definition automatic lookups. This is
  • 4:06 - 4:09
    great. So instead of having to invoke
  • 4:09 - 4:11
    that lookup command and during the
  • 4:11 - 4:13
    search, I can go ahead and set up an
  • 4:13 - 4:15
    automatic lookup
  • 4:15 - 4:18
    that will be invoked at search time and
  • 4:18 - 4:20
    bring that information in that you would
  • 4:20 - 4:22
    need.
  • 4:22 - 4:25
    So last thing I'm going to talk about on
  • 4:25 - 4:29
    this page is commands and lookups. There
  • 4:29 - 4:31
    is three commands that are related to
  • 4:31 - 4:34
    lookup tables.
  • 4:34 - 4:36
    I've already shown and
  • 4:36 - 4:38
    look up, but there's also input lookup
  • 4:38 - 4:41
    and output lookup.
  • 4:41 - 4:43
    So you can manually create your lookup
  • 4:43 - 4:47
    file or we can actually use the output
  • 4:47 - 4:49
    lookup in a Splunk search to create a
  • 4:49 - 4:51
    lookup table
  • 4:51 - 4:54
    to get that information into Splunk. So
  • 4:54 - 4:56
    you can use it with other Splunk
  • 4:56 - 4:58
    searches, and I will go over and we're
  • 4:58 - 5:02
    going to build that out today.
  • 5:02 - 5:03
    So let's back up
  • 5:03 - 5:05
    here's that where I'm using the lookup
  • 5:05 - 5:07
    command there
  • 5:07 - 5:10
    with this lookup table,
  • 5:10 - 5:13
    we have a couple different ways of be
  • 5:13 - 5:16
    able to look at what data is in that
  • 5:16 - 5:19
    lookup table at CSV file and that's that
  • 5:19 - 5:22
    input lookup command is one way,
  • 5:22 - 5:25
    and then there's an app that you can
  • 5:25 - 5:27
    download. So let me show off the input
  • 5:27 - 5:29
    lookup command real quick. So input look
  • 5:29 - 5:31
    up and you can see I've already used
  • 5:31 - 5:33
    this command before,
  • 5:33 - 5:36
    and before I go any further,
  • 5:36 - 5:39
    if you like how you know I get you know
  • 5:39 - 5:41
    I'll click input lookup, if you like how
  • 5:41 - 5:42
    I'm getting a lot of information over
  • 5:42 - 5:44
    here and if you're not getting this much
  • 5:44 - 5:46
    information like when I click more
  • 5:46 - 5:49
    you'll go up to administrator or you
  • 5:49 - 5:50
    know whoever you're logged in as your
  • 5:50 - 5:54
    user account name. Go to preferences
  • 5:54 - 5:57
    and then SPL editor and you can change
  • 5:57 - 5:59
    this on your account for your preference.
  • 5:59 - 6:02
    It's where it you know Splunk by default
  • 6:02 - 6:04
    will have it on Compact and you can
  • 6:04 - 6:06
    select full,
  • 6:06 - 6:08
    and then uh if you've ever noticed when
  • 6:08 - 6:11
    I hit the pipe,
  • 6:11 - 6:14
    it drops down a new line. That's this
  • 6:14 - 6:18
    search auto format. So I select it. So it
  • 6:18 - 6:19
    automatically drops a new line every
  • 6:19 - 6:21
    time, and you'll probably see that here
  • 6:21 - 6:24
    in a minute. So I'm going to go ahead and
  • 6:24 - 6:27
    hit cancel. So I have input lookup and
  • 6:27 - 6:30
    what was that Hall, yep.
  • 6:30 - 6:31
    I've already got it there. So I'll just
  • 6:31 - 6:34
    click on that and click run.
  • 6:34 - 6:38
    So all this command does is bring the
  • 6:38 - 6:41
    data into a Splunk search so I can view
  • 6:41 - 6:42
    it.
  • 6:42 - 6:45
    This is a CSV file that I have uploaded
  • 6:45 - 6:48
    I have edited and made adjustments to it,
  • 6:48 - 6:50
    and this is a CSV file that is being
  • 6:50 - 6:53
    used in this search to where my
  • 6:53 - 6:55
    destination IP will go down here if it
  • 6:55 - 6:59
    makes a match. It outputs me the hostname,
  • 6:59 - 7:02
    now the other way that we can edit this
  • 7:02 - 7:03
    file
  • 7:03 - 7:07
    is an app, and do I have that up? Nope. So
  • 7:07 - 7:09
    we'll go here, apps,
  • 7:09 - 7:11
    and we're going to go to Splunk app for
  • 7:11 - 7:14
    lookup file,
  • 7:14 - 7:16
    and this is an app that I've downloaded
  • 7:16 - 7:18
    off of Splunk base.
  • 7:18 - 7:21
    If you've never, I'll back up or before I
  • 7:21 - 7:22
    go too much further if you've never
  • 7:22 - 7:24
    heard of Splunk base, this is, you know,
  • 7:24 - 7:25
    our
  • 7:25 - 7:27
    App Store,
  • 7:27 - 7:30
    and we can either you know go to
  • 7:30 - 7:33
    splunkbase.splunk.com,
  • 7:33 - 7:38
    and do a search in here for lookup
  • 7:38 - 7:43
    um file there. It is look up file editing
  • 7:43 - 7:45
    or just you know back at your favorite
  • 7:45 - 7:49
    search engine Splunk base lookup editor,
  • 7:49 - 7:51
    and you'll get links to the same
  • 7:51 - 7:52
    location.
  • 7:52 - 7:55
    I will, I will point out with the new
  • 7:55 - 7:57
    Splunk base. We are
  • 7:57 - 8:00
    Splunk is, you know, providing a new
  • 8:00 - 8:03
    Splunk base over the old one
  • 8:03 - 8:06
    sometimes. If I were to just put
  • 8:06 - 8:10
    look up, you may not see that information
  • 8:10 - 8:12
    you know that app down here and even if
  • 8:12 - 8:14
    I run a search,
  • 8:14 - 8:17
    you may not see it so make sure to put
  • 8:17 - 8:19
    in lookup file
  • 8:19 - 8:22
    if you go to the old Splunk base,
  • 8:22 - 8:25
    you know, if I type in look up there. It's
  • 8:25 - 8:27
    the first entry. So hopefully our product
  • 8:27 - 8:29
    team is working on or whoever's working
  • 8:29 - 8:32
    on the website is you know adjusting
  • 8:32 - 8:33
    that,
  • 8:33 - 8:36
    and then the last way that we could you
  • 8:36 - 8:39
    know bring in that lookup app is to go
  • 8:39 - 8:41
    to apps.
  • 8:41 - 8:43
    Find more apps,
  • 8:43 - 8:48
    and then the same thing here look up,
  • 8:49 - 8:53
    and if I type in, let's say edit.
  • 8:53 - 8:54
    There it is
  • 8:54 - 8:56
    probably any other I just didn't feel
  • 8:56 - 8:58
    like scrolling down but here, you know,
  • 8:58 - 9:00
    you can just install that way if your
  • 9:00 - 9:04
    Splunk environment is internet
  • 9:04 - 9:05
    capable,
  • 9:05 - 9:07
    I worked in an environment that that was
  • 9:07 - 9:10
    not the case.
  • 9:10 - 9:12
    So now let's talk about the output
  • 9:12 - 9:16
    lookup command, and how to use it
  • 9:16 - 9:19
    and I'm actually going to go back into
  • 9:19 - 9:20
    here.
  • 9:20 - 9:22
    I want to show
  • 9:22 - 9:26
    DHCP. So here you can see that lookup
  • 9:26 - 9:29
    this is that app for Splunk
  • 9:29 - 9:33
    for lookup file editing, I am filtering
  • 9:33 - 9:35
    all of my, you know, there is a lot more
  • 9:35 - 9:38
    I'll back up there is a lot of lookup
  • 9:38 - 9:40
    tables that are loaded in my environment.
  • 9:40 - 9:42
    I am using the Splunk Security
  • 9:42 - 9:44
    Essentials app. It's a free app that you
  • 9:44 - 9:46
    can also download from Splunk base,
  • 9:46 - 9:48
    you know, if you are in that security
  • 9:48 - 9:50
    business, please check it out. There's one
  • 9:50 - 9:54
    for compliance. There's one it
  • 9:54 - 9:56
    essentials. So we have a lot of good apps
  • 9:56 - 9:58
    out there to help you get going,
  • 9:58 - 10:00
    but here. I'm going to go
  • 10:00 - 10:05
    DHCP and you can see the the one CSV
  • 10:05 - 10:07
    that I have right now,
  • 10:07 - 10:10
    and what we're going to do here is a
  • 10:10 - 10:12
    base search that has given me the IP
  • 10:12 - 10:15
    address, but I would rather or I need the
  • 10:15 - 10:17
    host name off to here,
  • 10:17 - 10:20
    luckily for me. I have
  • 10:20 - 10:24
    another data source that I'm using open
  • 10:24 - 10:26
    sense in a DHCP server,
  • 10:26 - 10:32
    and if I will go ahead and run this.
  • 10:33 - 10:35
    It will give me the raw logs and In The
  • 10:35 - 10:37
    Raw logs, I have my IP address and it
  • 10:37 - 10:41
    also has host names in here,
  • 10:41 - 10:43
    and I can look at my interesting Fields
  • 10:43 - 10:48
    because I have the open sense ta
  • 10:48 - 10:51
    app that I downloaded, but helps me to
  • 10:51 - 10:53
    parse this data and you can see over
  • 10:53 - 10:55
    here in interesting Fields. I have client
  • 10:55 - 10:58
    IP Mac and name.
  • 10:58 - 10:59
    So now,
  • 10:59 - 11:01
    I want
  • 11:01 - 11:05
    to create a lookup table with these
  • 11:05 - 11:07
    three fields.
  • 11:07 - 11:10
    I'm going to hit the pipe. I'm going to
  • 11:10 - 11:13
    say stats count by
  • 11:13 - 11:19
    what was that clients underscore, name
  • 11:19 - 11:20
    a client
  • 11:20 - 11:25
    underscore IP and client underscore Mac
  • 11:25 - 11:27
    remember your field names are case
  • 11:27 - 11:29
    sensitive,
  • 11:31 - 11:32
    not the values but the field names
  • 11:32 - 11:34
    himself are.
  • 11:34 - 11:36
    And once this comes up, it should give me
  • 11:36 - 11:39
    it gives me four columns, and if I don't
  • 11:39 - 11:41
    want to count here in my lookup table.
  • 11:41 - 11:44
    I'm just going to say you know easiest
  • 11:44 - 11:48
    way Fields negative counts
  • 11:48 - 11:51
    and that will clean it up, and this is
  • 11:51 - 11:54
    the output that I would like to have.
  • 11:54 - 11:58
    So next, I'm going to invoke the output
  • 11:58 - 12:02
    lookup command. So let's click on that
  • 12:02 - 12:04
    and then I already have in my command
  • 12:04 - 12:06
    history because I practice this before I
  • 12:06 - 12:07
    record a video
  • 12:07 - 12:11
    output lookup DHCP test and if you know
  • 12:11 - 12:13
    when I'm here
  • 12:13 - 12:14
    in my
  • 12:14 - 12:17
    Splunk environment. It is not here yet. So
  • 12:17 - 12:20
    let's go ahead and click on that and as
  • 12:20 - 12:21
    soon as I run this,
  • 12:21 - 12:24
    and I give it a few seconds,
  • 12:24 - 12:25
    there we go.
  • 12:25 - 12:28
    You know I have an output.
  • 12:28 - 12:32
    It may not be a hundred percent but it's
  • 12:32 - 12:34
    a start. You don't have to build
  • 12:34 - 12:36
    everything from scratch.
  • 12:36 - 12:38
    So I can have this here and start
  • 12:38 - 12:40
    editing this
  • 12:40 - 12:43
    lookup table with the file lookup
  • 12:43 - 12:45
    editor. So I 100 recommend downloading
  • 12:45 - 12:47
    that app to look you know edit the
  • 12:47 - 12:50
    lookup tables because if you don't, you'd
  • 12:50 - 12:53
    have to be in the business of pulling
  • 12:53 - 12:56
    that look up table from your Splunk
  • 12:56 - 12:59
    index or search heads bring it down to
  • 12:59 - 13:02
    your computer edit it or log into the
  • 13:02 - 13:05
    box and edit it manually like that. So
  • 13:05 - 13:07
    the lookup editor is definitely one of
  • 13:07 - 13:08
    the
  • 13:08 - 13:10
    first apps that I install on a fresh
  • 13:10 - 13:13
    Splunk install, but here, you can see I
  • 13:13 - 13:15
    have you know tab a and tab a oh which
  • 13:15 - 13:16
    one are there two different Mac
  • 13:16 - 13:19
    addresses. Two different IPS, my kids both
  • 13:19 - 13:21
    have a tablet. So if I wanted to know
  • 13:21 - 13:23
    which tablet is which you know grab the
  • 13:23 - 13:25
    tablet,
  • 13:25 - 13:27
    you know look up the MAC address and
  • 13:27 - 13:29
    make sure I know which one it is and
  • 13:29 - 13:31
    update my lookup table. So if we go back
  • 13:31 - 13:32
    here to
  • 13:32 - 13:35
    this lookup app the Splunk app for uh
  • 13:35 - 13:38
    look lookup file editing and re-run this
  • 13:38 - 13:39
    search,
  • 13:39 - 13:43
    let's see here just hit refresh
  • 13:43 - 13:46
    and I'll have to put in DHCP again. There
  • 13:46 - 13:49
    is that lookup table,
  • 13:49 - 13:52
    and if I wanted to, I can just click in
  • 13:52 - 13:53
    here,
  • 13:53 - 13:55
    and now,
  • 13:55 - 13:59
    I can start editing this lookup file. So
  • 13:59 - 14:03
    I like this device here is, you know,
  • 14:03 - 14:05
    my work
  • 14:06 - 14:09
    underscore,
  • 14:09 - 14:11
    you know, laptop,
  • 14:11 - 14:13
    you know, this is
  • 14:13 - 14:16
    you know, Dash child
  • 14:16 - 14:18
    one,
  • 14:18 - 14:20
    and then we have
  • 14:20 - 14:24
    Dash child two.
  • 14:24 - 14:26
    Click save. You know we can add more
  • 14:26 - 14:28
    columns so if I know
  • 14:28 - 14:31
    um like right now none of my firewall
  • 14:31 - 14:34
    ports are showing up. So I could say
  • 14:34 - 14:37
    firewall,
  • 14:37 - 14:39
    and if I have the IP address, I can put
  • 14:39 - 14:40
    that in there and if I had the MAC
  • 14:40 - 14:43
    address,
  • 14:43 - 14:46
    dot you know 1.1.
  • 14:46 - 14:49
    Let's uh sure,
  • 14:49 - 14:51
    just for fun because it doesn't matter,
  • 14:51 - 14:55
    I'll just plug this in and you know call
  • 14:55 - 14:57
    it 99.
  • 14:57 - 14:59
    Save.
  • 14:59 - 15:02
    Now when I come back over here
  • 15:02 - 15:04
    and I rerun this,
  • 15:04 - 15:07
    um well actually if I rerun this ooh,
  • 15:07 - 15:09
    almost messed up, if I rerun this it'll
  • 15:09 - 15:11
    overwrite the changes well, I'll show you
  • 15:11 - 15:15
    that let's see here bam
  • 15:17 - 15:18
    foreign
  • 15:18 - 15:22
    if I go back over here click lookups.
  • 15:22 - 15:26
    Refresh this. Let's see. I'll do another
  • 15:26 - 15:28
    refresh here,
  • 15:28 - 15:31
    and I'll type in DHCP
  • 15:31 - 15:35
    and click DHCP test.
  • 15:35 - 15:38
    You can see those changes I made are
  • 15:38 - 15:42
    gone now so be careful with that command
  • 15:42 - 15:44
    with the output lookup.
  • 15:44 - 15:45
    [Music]
  • 15:45 - 15:46
    Um,
  • 15:46 - 15:49
    so yeah let's, I'll do this time, I'll
  • 15:49 - 15:52
    just do this one here and I'll say you
  • 15:52 - 15:53
    know work,
  • 15:53 - 15:55
    laptop,
  • 15:55 - 15:57
    and, you know, I just want to show you
  • 15:57 - 15:59
    that you know
  • 15:59 - 16:02
    one
  • 16:02 - 16:05
    and then Dash two that it does work when
  • 16:05 - 16:07
    you click save lookup,
  • 16:07 - 16:10
    and what I can do is come here and
  • 16:10 - 16:13
    actually I will
  • 16:13 - 16:16
    open a new search
  • 16:16 - 16:21
    and do a pipe input look up
  • 16:21 - 16:22
    DH.
  • 16:22 - 16:24
    Yeah.
  • 16:24 - 16:27
    DHCP underscore test,
  • 16:27 - 16:30
    not CSV.
  • 16:32 - 16:35
    And you can see now instead of
  • 16:35 - 16:37
    um what it was before I get my work
  • 16:37 - 16:41
    laptop, and now I have one and two
  • 16:43 - 16:46
    and then for this here, you know, I can
  • 16:46 - 16:48
    easily come back you know come back to
  • 16:48 - 16:52
    my previous search or I can type it out
  • 16:52 - 16:54
    here. I think I've got it copied over
  • 16:54 - 16:55
    here,
  • 16:55 - 17:00
    you know. Now, I can you know quickly
  • 17:00 - 17:03
    oops got to get rid of the extra pipe
  • 17:03 - 17:05
    when I copied it,
  • 17:05 - 17:08
    and then
  • 17:10 - 17:13
    actually what I'll do is
  • 17:13 - 17:15
    fields,
  • 17:15 - 17:19
    and say dust underscore IP,
  • 17:19 - 17:24
    and then stats count by dust underscore
  • 17:24 - 17:27
    IP host name,
  • 17:33 - 17:34
    and voila.
  • 17:34 - 17:37
    So you can see
  • 17:37 - 17:38
    where it's grabbing that information. Oh
  • 17:38 - 17:41
    I got the wrong
  • 17:42 - 17:44
    DHCP,
  • 17:44 - 17:49
    underscore test dot CSV,
  • 17:54 - 17:56
    oh
  • 17:56 - 18:00
    and you can see I have IP here,
  • 18:00 - 18:02
    and what I needed to do was actually go
  • 18:02 - 18:04
    back to my lookup table,
  • 18:04 - 18:07
    and say
  • 18:07 - 18:12
    client underscore IP
  • 18:12 - 18:15
    and then I believe it's the first one
  • 18:15 - 18:18
    here so let's just test that out
  • 18:18 - 18:20
    client.
  • 18:20 - 18:23
    What did I call that field, again?
  • 18:23 - 18:25
    client name
  • 18:25 - 18:29
    underscore name.
  • 18:31 - 18:34
    And there you go see there's the 133
  • 18:34 - 18:37
    which was the A1, and in there is my work
  • 18:37 - 18:40
    laptop. So you got to see you got to see
  • 18:40 - 18:41
    me fail
  • 18:41 - 18:44
    with the field names, but that's a good
  • 18:44 - 18:47
    thing because then you saw where you
  • 18:47 - 18:49
    know the first field is in your lookup
  • 18:49 - 18:52
    table to match in your search results,
  • 18:52 - 18:54
    you know. So, the client IP as destination
  • 18:54 - 18:56
    IP and then the client name as hostname.
  • 18:56 - 19:00
    So instead of it coming out as a client
  • 19:00 - 19:02
    name, I have it as you can you know I
  • 19:02 - 19:06
    could have easily done this
  • 19:06 - 19:10
    and say client underscore name
  • 19:10 - 19:13
    if I wanted to.
  • 19:13 - 19:15
    You know if that makes more sense for
  • 19:15 - 19:17
    you as well,
  • 19:18 - 19:20
    and once you've defined that lookup
  • 19:20 - 19:22
    table, and you've got it incorporated
  • 19:22 - 19:24
    into Splunk you know we can start adding
  • 19:24 - 19:26
    that information to dashboards. You may
  • 19:26 - 19:29
    have built or other reports so here is a
  • 19:29 - 19:32
    a dashboard that I created that looks at
  • 19:32 - 19:35
    all the you know devices in my network.
  • 19:35 - 19:38
    I use my information my data from the
  • 19:38 - 19:40
    DHCP server and compare it to the lookup
  • 19:40 - 19:43
    table to see. If there's any changes you
  • 19:43 - 19:46
    know, if a new device grabbed a an IP on
  • 19:46 - 19:49
    my network that I didn't know about, you
  • 19:49 - 19:51
    know I could set up alerts around this
  • 19:51 - 19:54
    you know. For example, I do have one here
  • 19:54 - 19:58
    for uh you know what so anytime a new
  • 19:58 - 20:00
    device comes on here, and it does not
  • 20:00 - 20:04
    find a match it actually outputs the
  • 20:04 - 20:07
    name what. So that I can go hey what is
  • 20:07 - 20:08
    this
  • 20:08 - 20:12
    yeah, and what is this so Nintendo 3DS,
  • 20:12 - 20:14
    So one of my kids found you know they
  • 20:14 - 20:16
    must have turned on their 3DS, they
  • 20:16 - 20:18
    haven't used in a while. So I'm gonna go
  • 20:18 - 20:21
    edit my lookup table, and here's the MAC
  • 20:21 - 20:23
    address. So let's go see if it's already
  • 20:23 - 20:27
    in that look up table and not this one
  • 20:27 - 20:29
    so I'm going to click lookups here and
  • 20:29 - 20:35
    go back into uh Hall DHCP leases,
  • 20:35 - 20:37
    and I can either do a filtered search
  • 20:37 - 20:39
    for nin,
  • 20:39 - 20:41
    and I have one here for an Nintendo 3DS,
  • 20:41 - 20:44
    but that's a different Mac address.
  • 20:44 - 20:47
    So let's just add this one in place
  • 20:47 - 20:49
    because I know there should be two of
  • 20:49 - 20:50
    them.
  • 20:50 - 20:52
    So I'll just you know insert a row
  • 20:52 - 20:54
    afterwards,
  • 20:54 - 20:58
    and we'll call this one Nintendo we'll
  • 20:58 - 21:00
    say three,
  • 21:00 - 21:03
    yeah three DS
  • 21:03 - 21:05
    two,
  • 21:05 - 21:08
    and we'll give it, yeah. We can see there.
  • 21:08 - 21:10
    It is the different Mac address
  • 21:10 - 21:12
    and then what IP address did it grab. So
  • 21:12 - 21:14
    I'll just grab this IP address because
  • 21:14 - 21:17
    that's what my DHCP server has,
  • 21:17 - 21:20
    and we will go back over here,
  • 21:20 - 21:23
    and we'll say this, I'm going to click
  • 21:23 - 21:26
    save lookup,
  • 21:26 - 21:29
    all right. And after clicking save look
  • 21:29 - 21:31
    up, I should be able to go back to my
  • 21:31 - 21:32
    dashboard,
  • 21:32 - 21:35
    and I'll just do a refresh
  • 21:36 - 21:39
    click okay. Didn't have to click submit,
  • 21:39 - 21:42
    and it should not have anything in the
  • 21:42 - 21:45
    red column and
  • 21:45 - 21:48
    there we go.
  • 21:54 - 21:56
    Oh,
  • 21:56 - 21:59
    interesting. So now I need to
  • 21:59 - 22:01
    as a client name and a host name is
  • 22:01 - 22:04
    different. So I'll play around with this
  • 22:04 - 22:04
    some more,
  • 22:04 - 22:07
    should be the same well client name is
  • 22:07 - 22:09
    what my DHCP server sees it, and then
  • 22:09 - 22:12
    this is the name I gave it. So I'll have
  • 22:12 - 22:15
    to go now go get the kids devices and
  • 22:15 - 22:17
    make sure that I don't have a rogue
  • 22:17 - 22:20
    Nintendo 3DS on my network which I
  • 22:20 - 22:22
    doubt it. I know we have two of them.
  • 22:22 - 22:25
    So hopefully this uh video was helpful
  • 22:25 - 22:28
    in introducing you to lookups and the
  • 22:28 - 22:30
    power of them. If you have any questions
  • 22:30 - 22:33
    or comments, please please leave them
  • 22:33 - 22:37
    below, and uh Happy spelunking.
Title:
Using a Lookup Table in Splunk
Description:

more » « less
Video Language:
English
Duration:
22:36

English subtitles

Revisions Compare revisions