<?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: Query including multiple CSV and Rex in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354634#M104949</link>
    <description>&lt;P&gt;Assuming all 3 datasets have a field called "site", like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Data1.csv | rename Data1Site AS site
| inputlookup append=t Data2.csv | rename Data2Site AS site
| inputlookup append=t Data3.csv | rename Data3Site AS site
| stats values(*) AS * BY site
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then just play around with the maps on the visualization tab.&lt;/P&gt;</description>
    <pubDate>Tue, 08 Aug 2017 17:34:53 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-08-08T17:34:53Z</dc:date>
    <item>
      <title>Query including multiple CSV and Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354630#M104945</link>
      <description>&lt;P&gt;Hello everyone, it's been a long long time that I've not used splunk. I would need some help to do a query or two please...&lt;/P&gt;

&lt;P&gt;There's 3 csv;&lt;BR /&gt;
Data1.csv = First CSV contains all the boxes hostnames in the field with this format "tsk-site-type" with other fields (ip, serialNumber, etc)&lt;BR /&gt;
Data2.csv  = Second CSV contains the sites that we will deploy this year &lt;BR /&gt;
Data3.csv  = Third CSV contains all the sites with the geographic coordinates&lt;/P&gt;

&lt;P&gt;I would like to have 2 things;&lt;BR /&gt;
-A list of all the information concatenated (including the site, the type, the coodinates and if it will be deployed this year)&lt;BR /&gt;
-A map with the hostnames of the sites that we will deploy this year&lt;/P&gt;

&lt;P&gt;All of this will go on a dashboard.&lt;/P&gt;

&lt;P&gt;Thanks for helping&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 15:23:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354630#M104945</guid>
      <dc:creator>metalshad05</dc:creator>
      <dc:date>2017-08-08T15:23:51Z</dc:date>
    </item>
    <item>
      <title>Re: Query including multiple CSV and Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354631#M104946</link>
      <description>&lt;P&gt;Those csv's, are they added to Splunk as lookup table file or are indexed?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 16:50:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354631#M104946</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-08T16:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Query including multiple CSV and Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354632#M104947</link>
      <description>&lt;P&gt;Hi Somesoni2,&lt;/P&gt;

&lt;P&gt;They are lookup tables&lt;/P&gt;

&lt;P&gt;| inputlookup Data1.csv &lt;/P&gt;

&lt;P&gt;Thanks for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 16:53:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354632#M104947</guid>
      <dc:creator>metalshad05</dc:creator>
      <dc:date>2017-08-08T16:53:08Z</dc:date>
    </item>
    <item>
      <title>Re: Query including multiple CSV and Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354633#M104948</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Data1.csv | table hostname ip serialNumber | eval site=replace(hostname,"^([^\-]+)\-([^\-]+)\-([^\-]+)$","\2") | lookup Data2.csv site OUTPUT site as WillDeployThisYear | eval WillDeployThisYear =if(isnotnull(WillDeployThisYear),"Yes","No") | lookup Data3.csv site OUTPUT langFieldNameHere longFieldNameHere
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Aug 2017 17:20:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354633#M104948</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-08-08T17:20:38Z</dc:date>
    </item>
    <item>
      <title>Re: Query including multiple CSV and Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354634#M104949</link>
      <description>&lt;P&gt;Assuming all 3 datasets have a field called "site", like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| inputlookup Data1.csv | rename Data1Site AS site
| inputlookup append=t Data2.csv | rename Data2Site AS site
| inputlookup append=t Data3.csv | rename Data3Site AS site
| stats values(*) AS * BY site
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;then just play around with the maps on the visualization tab.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 17:34:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354634#M104949</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-08-08T17:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Query including multiple CSV and Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354635#M104950</link>
      <description>&lt;P&gt;Hi woodcock,&lt;/P&gt;

&lt;P&gt;Thanks a lot for your time! I juste need 2 more things as asked in my question; &lt;/P&gt;

&lt;P&gt;For Data1Site, I need to extract the site name and the type in 2 new columns using regex&lt;BR /&gt;
For Data2Site, I need some kind of flag stating if it will be done this year please&lt;/P&gt;

&lt;P&gt;Thanks again&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 17:52:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354635#M104950</guid>
      <dc:creator>metalshad05</dc:creator>
      <dc:date>2017-08-08T17:52:57Z</dc:date>
    </item>
    <item>
      <title>Re: Query including multiple CSV and Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354636#M104951</link>
      <description>&lt;P&gt;Did you try it?  It should provide a basis for all of your logic.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 19:10:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354636#M104951</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-08-08T19:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: Query including multiple CSV and Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354637#M104952</link>
      <description>&lt;P&gt;I did, it's not working because I need to do the regex to have the site name&lt;BR /&gt;
The actual format is &lt;BR /&gt;
Data1.csv contains hostname in lowercase: "tsk-site-type" (ie tsk-ranc-rscc01)&lt;BR /&gt;
Data2.csv contains Site in uppercase (ie RANC)&lt;/P&gt;

&lt;P&gt;So I need at least a rex to get a new column for the site name and the type to do the join by site&lt;/P&gt;

&lt;P&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2017 20:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354637#M104952</guid>
      <dc:creator>metalshad05</dc:creator>
      <dc:date>2017-08-08T20:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: Query including multiple CSV and Rex</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354638#M104953</link>
      <description>&lt;P&gt;Fine, then you need to do a &lt;CODE&gt;| rename&lt;/CODE&gt; and also &lt;CODE&gt;| eval site=lower(site)&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2017 11:59:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Query-including-multiple-CSV-and-Rex/m-p/354638#M104953</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-08-09T11:59:17Z</dc:date>
    </item>
  </channel>
</rss>

