<?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 to search and table IP addresses to see which ones are active? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144063#M40081</link>
    <description>&lt;P&gt;Whatever your source file is that feeds into the DEVICE index. Perhaps its a .csv or a .txt file that lists all of those IPs??&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jul 2014 13:07:34 GMT</pubDate>
    <dc:creator>Jeff_Lightly_Sp</dc:creator>
    <dc:date>2014-07-17T13:07:34Z</dc:date>
    <item>
      <title>How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144038#M40056</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I am trying to do a complex search for almost 500 IP addresses to see which ones are active. My query looks like this:&lt;BR /&gt;
index=DEVICE | table srcip IP OR IP OR IP and so on.&lt;BR /&gt;
However; the table with the source iP addresses that I got back has IP address for each event. Is there anyone to get the IP address only once to check if it's active or not? Also, I am not sure if there is any efficient query that I could use instead of all ORs? &lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 17:56:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144038#M40056</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-15T17:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144039#M40057</link>
      <description>&lt;P&gt;Could you post some sample data?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 17:58:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144039#M40057</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-15T17:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144040#M40058</link>
      <description>&lt;P&gt;Sample data?&lt;BR /&gt;
That's my query&lt;BR /&gt;
index=DEVICE (source device) | table srcip IP OR IP OR IP &lt;BR /&gt;
I am getting a table with source IP address from each even. I am trying to remove duplicates.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 18:12:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144040#M40058</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-15T18:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144041#M40059</link>
      <description>&lt;P&gt;I'm asking for sample data because I don't understand what &lt;CODE&gt;... | table srcip IP OR IP OR IP&lt;/CODE&gt; is meant to do. Neither do I know what kind of data you have in your DEVICE index.&lt;/P&gt;

&lt;P&gt;Take a few lines of your source file, anonymize sensitive data, and paste it here.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 18:14:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144041#M40059</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-15T18:14:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144042#M40060</link>
      <description>&lt;P&gt;[updated to replace src_ip with srcip]&lt;/P&gt;

&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=DEVICE | stats count by srcip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;assuming that srcip is an actual field that represents the IP addresses&lt;/P&gt;

&lt;P&gt;If you need to compare the list of IP addresses in the index with a fixed list of 500 IPs, then my suggestion is this:&lt;BR /&gt;&lt;BR /&gt;
First, put the IP addresses in a lookup table&lt;BR /&gt;&lt;BR /&gt;
Then, use the following to restrict your search to only those IP addresses&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=DEVICE [ | inputlookup ip_lookup.csv ] | stats count by srcip
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;which assumes that &lt;CODE&gt;ip_lookup.csv&lt;/CODE&gt; contains a list of &lt;CODE&gt;srcip&lt;/CODE&gt; addresses like so&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;srcip
10.1.3.154
192.168.0.1
135.15.24.79
etc
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Jul 2014 18:57:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144042#M40060</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-07-15T18:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144043#M40061</link>
      <description>&lt;P&gt;index=DEVICE |dedup srcip |...&lt;/P&gt;

&lt;P&gt;will eliminate duplicate IPs.&lt;/P&gt;

&lt;P&gt;As to the searching for a big list of addresses, you want to look into "lookup" tables or "input CSV" files. By the way, you can use CIDR blocks in the search, lookup file or input CSV file.&lt;/P&gt;

&lt;P&gt;You can create an input CSV file by putting a file in the:&lt;BR /&gt;
$SPLUNK_HOME/var/run/splunk/&lt;BR /&gt;
folder and call it something like myips.csv.&lt;/P&gt;

&lt;P&gt;The first line of the file should be srcip and each line after that can be an IP address. Then you can limit your search as follows:&lt;/P&gt;

&lt;P&gt;index=DEVICE [|inputcsv "myips.csv"] | dedup srcip | table srcip&lt;/P&gt;

&lt;P&gt;This will give you a list of the srcip entries that matched those in the file and only print one of each. You can do something in the reverse to find those that are missing from your file:&lt;/P&gt;

&lt;P&gt;|inputcsv "myips.csv" NOT [index=DEVICE |dedup srcip|fields srcip]&lt;/P&gt;

&lt;P&gt;This last search will work for a small time range, but the subsearch may time out on longer ones. A more complete solution to that is a bit more involved, but can be done. &lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 19:07:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144043#M40061</guid>
      <dc:creator>reed_kelly</dc:creator>
      <dc:date>2014-07-15T19:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144044#M40062</link>
      <description>&lt;P&gt;Thanks for the all replies. &lt;BR /&gt;
Ok, so my query now looks like this&lt;BR /&gt;
index=DEVICE | dedup srcip IP OR IP OR IP&lt;BR /&gt;
When I start searching,I get "Error in 'dedup' command: The field 'OR' is specified multiple times. It should only be specified once. " I am not sure why?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 19:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144044#M40062</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-15T19:26:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144045#M40063</link>
      <description>&lt;P&gt;The CSV input file or lookup file as lguinn suggested are the way to go. If you cannot use either of those approaches, then searching for srcip in a large set should be done at the front of the search. You also have to put OR conditions in parenthesis. Something like:&lt;/P&gt;

&lt;P&gt;index=DEVICE (srcip=IP1 OR srcip=IP2 OR ... OR srcip=IP500)&lt;/P&gt;

&lt;P&gt;The dedup command requires another pipe | as follows:&lt;/P&gt;

&lt;P&gt;index=DEVICE (srcip=IP1 OR ...) | dedup srcip&lt;/P&gt;

&lt;P&gt;To put the results in a table, you need to add the table command:&lt;/P&gt;

&lt;P&gt;index=DEVICE (srcip=IP1 OR ...) | dedup srcip | table srcip&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 19:45:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144045#M40063</guid>
      <dc:creator>reed_kelly</dc:creator>
      <dc:date>2014-07-15T19:45:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144046#M40064</link>
      <description>&lt;P&gt;To upload a lookup file, you can follow the instructions here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/Usefieldlookups#Upload_the_lookup_table_file"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchTutorial/Usefieldlookups#Upload_the_lookup_table_file&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Is your field srcip or src_ip (with an underscore)? In the later case, follow lguinn's instructions along with the above docs.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 19:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144046#M40064</guid>
      <dc:creator>reed_kelly</dc:creator>
      <dc:date>2014-07-15T19:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144047#M40065</link>
      <description>&lt;P&gt;Thank for your reply. How would the query look like if I want to type in the IP addresses instead of using .csv file?&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 20:00:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144047#M40065</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-15T20:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144048#M40066</link>
      <description>&lt;P&gt;Like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=DEVICE (src_ip="1.1.1.1" OR src_ip="1.1.1.2" OR src_ip="1.1.1.3" OR ...) | stats count by src_ip
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Jul 2014 20:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144048#M40066</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-15T20:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144049#M40067</link>
      <description>&lt;P&gt;I ran this&lt;BR /&gt;
index=DEVICE (srcip=IP1 OR ...) | dedup srcip | table srcip&lt;BR /&gt;
I'll see if it works. Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 20:22:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144049#M40067</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-15T20:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144050#M40068</link>
      <description>&lt;P&gt;I ran this one as well. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jul 2014 20:22:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144050#M40068</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-15T20:22:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144051#M40069</link>
      <description>&lt;P&gt;"No results found." It didn't work. It should have found results.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2014 12:05:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144051#M40069</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-16T12:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144052#M40070</link>
      <description>&lt;P&gt;Didn't work. No results.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2014 12:07:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144052#M40070</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-16T12:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144053#M40071</link>
      <description>&lt;P&gt;...which is the reason why I asked for sample data. Do your events have a field for the IP, and what's the name of that field?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2014 12:18:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144053#M40071</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-16T12:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144054#M40072</link>
      <description>&lt;P&gt;srcip which is what I need&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2014 12:56:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144054#M40072</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-16T12:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144055#M40073</link>
      <description>&lt;P&gt;Did you remove the underscores from my query?&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2014 12:57:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144055#M40073</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-07-16T12:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144056#M40074</link>
      <description>&lt;P&gt;No, I'll do that now. I am new to this.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2014 13:06:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144056#M40074</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-16T13:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to search and table IP addresses to see which ones are active?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144057#M40075</link>
      <description>&lt;P&gt;Didn't work.&lt;/P&gt;</description>
      <pubDate>Wed, 16 Jul 2014 13:11:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-search-and-table-IP-addresses-to-see-which-ones-are/m-p/144057#M40075</guid>
      <dc:creator>m8733</dc:creator>
      <dc:date>2014-07-16T13:11:40Z</dc:date>
    </item>
  </channel>
</rss>

