<?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 do I use &amp;quot;cidrmatch&amp;quot; to pull a field from a csv using another field in the csv as the cidr? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-use-quot-cidrmatch-quot-to-pull-a-field-from-a-csv/m-p/436409#M76133</link>
    <description>&lt;P&gt;Edit: This is NOT an answer, it is a work around.&lt;/P&gt;

&lt;P&gt;I have since been able to get the data I needed, but only on our instance of Splunk ES...and only on active searches, not scheduled. I think there may be a setting in the background that I am not aware of.&lt;/P&gt;

&lt;P&gt;The code that works is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count by host

    | lookup dnslookup clienthost as host OUTPUT clientip as Source_IP
    | lookup dnslookup clientip as Source_IP OUTPUT clienthost as SourceName

    |lookup ipam_report.csv network AS Source_IP OUTPUT network, location, owner, sitecode, vlan

    | stats
    values(host) as host
    values(SourceName) as SourceName
    sum(count) as Counted
    values(network) as network
    values(location) as location
    values(owner) as owner
    values(sitecode) as sitecode
    values(vlan) as vlan
    by Source_IP
    |sort - Counted
    | table host, Source_IP, network, vlan, SourceName, sitecode, location, owner, Counted
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 07 Sep 2018 13:32:33 GMT</pubDate>
    <dc:creator>Braagi</dc:creator>
    <dc:date>2018-09-07T13:32:33Z</dc:date>
    <item>
      <title>How do I use "cidrmatch" to pull a field from a csv using another field in the csv as the cidr?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-use-quot-cidrmatch-quot-to-pull-a-field-from-a-csv/m-p/436408#M76132</link>
      <description>&lt;P&gt;Yet another issue with "cidrmatch."&lt;BR /&gt;
All I can get is DATA="Not working" to populate. I need it to populate with the data from the "extattrs" field. Any ideas?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count by host
| lookup dnslookup clienthost as host OUTPUT clientip as Source_IP
| lookup dnslookup clientip as Source_IP OUTPUT clienthost as SourceName

|append [|inputlookup ipam_report.csv |fields network, extattrs]
| eval DATA=if(cidrmatch(network, Source_IP), extattrs, "Not working")

| stats
values(host) as host
values(SourceName) as SourceName
values(count) as Counted
values(DATA) as DATA
by Source_IP
|sort - Counted
| table host, Source_IP, SourceName, DATA, Counted
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Aug 2018 17:52:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-use-quot-cidrmatch-quot-to-pull-a-field-from-a-csv/m-p/436408#M76132</guid>
      <dc:creator>Braagi</dc:creator>
      <dc:date>2018-08-30T17:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use "cidrmatch" to pull a field from a csv using another field in the csv as the cidr?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-use-quot-cidrmatch-quot-to-pull-a-field-from-a-csv/m-p/436409#M76133</link>
      <description>&lt;P&gt;Edit: This is NOT an answer, it is a work around.&lt;/P&gt;

&lt;P&gt;I have since been able to get the data I needed, but only on our instance of Splunk ES...and only on active searches, not scheduled. I think there may be a setting in the background that I am not aware of.&lt;/P&gt;

&lt;P&gt;The code that works is :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | tstats count by host

    | lookup dnslookup clienthost as host OUTPUT clientip as Source_IP
    | lookup dnslookup clientip as Source_IP OUTPUT clienthost as SourceName

    |lookup ipam_report.csv network AS Source_IP OUTPUT network, location, owner, sitecode, vlan

    | stats
    values(host) as host
    values(SourceName) as SourceName
    sum(count) as Counted
    values(network) as network
    values(location) as location
    values(owner) as owner
    values(sitecode) as sitecode
    values(vlan) as vlan
    by Source_IP
    |sort - Counted
    | table host, Source_IP, network, vlan, SourceName, sitecode, location, owner, Counted
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 07 Sep 2018 13:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-use-quot-cidrmatch-quot-to-pull-a-field-from-a-csv/m-p/436409#M76133</guid>
      <dc:creator>Braagi</dc:creator>
      <dc:date>2018-09-07T13:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use "cidrmatch" to pull a field from a csv using another field in the csv as the cidr?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-use-quot-cidrmatch-quot-to-pull-a-field-from-a-csv/m-p/436410#M76134</link>
      <description>&lt;P&gt;hi @braagi, I'm glad you figured out a solution to your problem. I converted your comment to an answer so that users could learn from your solution. Would you mind approving it for me? Thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 08 Sep 2018 00:05:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-use-quot-cidrmatch-quot-to-pull-a-field-from-a-csv/m-p/436410#M76134</guid>
      <dc:creator>mstjohn_splunk</dc:creator>
      <dc:date>2018-09-08T00:05:59Z</dc:date>
    </item>
  </channel>
</rss>

