- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How can I combine two CSV files?
Hi Everyone,
I want to combine data from two .csv files which are "CBIG-SIN Updated" and "Hostnames Files" files names and the output should be displayed in one file with relevant information of each file. In both the files the Header names are different.
I have tried the commands such as inputlookup, inputcsv and then the append with the next file. But none of them are working.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please suggest
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@Sagar0511, can you give what are the field names in the two CSV and how do you want the output with sample mock data in tabular format?
| makeresults | eval message= "Happy Splunking!!!"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Header of file1: Date Time Interface Origin Type Action Service Source Port Source Destination Protocol Rule Rule Name Current Rule Number User Information Product Source Machine Name Source User Name
Header of file2: Name Type Location FW1 IP-Address Netmask NAT-Address NAT-Type Members Comment
In the result/Output I want both the result combining of File1 and File2. So it will be easy to search the hostnames/IP's
CBIG_SIN is the CSV file name.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

can you post sample data of both the files and final sample output you require? We have no clue what you mean by CBIG_SIN until there is some sample data.
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please find the below same Header and data for both the files
Header and data of first csv file
Number-Date-Time-Interface-Origin-Type-Action-Service-Source Port-Source-Destination-Protocol-Rule-Rule Name-Current Rule Number-User-Information-Product-SourceMachineName-Source User Name
1-16-Oct-17-23:58:58-eth2-xxxx-Log-Drop-xxxx-38611-hostxx.xx.xx.xx.static.arubacloud.de-xx.xx.xxx.xxx udp-26-26CBIG-SIN-Consolidation-NA-NA-Security Gateway/Management-NA-NA
2-16-Oct-17-23:59:00-eth1-xxxx-Log-Accep-xxxx-62006-Host_xx.xx.xx.xx.-SINDSITNCDB03AV_xx.xxx.xxx.xxx tcp-271- 271-CBIG-SIN-Consolidation-NA-inzone Internal outzone Externalservice_id: TCP_135-Security Gateway/Management-NA-NA
Header and Data of second csv file
Nr-Name-Type-Location-FW1-IP-Netmask-NATAddress-NATType-Members-Comment
1 Attack_IP_xx.x.xx.xxx host-NA-NA-xx.x.xx.xxx-NA-NA-NA-NA-NA
2 xx.xx.xx.xxx group-NA-NA-NA-NA-NA-NA-Net_xx.xx.x.x Net_xx.xx.x.x-x-NA
3 UFTP_xx.xx.xx.xxx host-NA-NA-xx.xx.xx.xxx-NA-NA-NA-NA-NA
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Header of file1: Date Time Interface Origin Type Action Service Source Port Source Destination Protocol Rule Rule Name Current Rule Number User Information Product Source Machine Name Source User Name
Header of file2: Name Type Location FW1 IP-Address Netmask NAT-Address NAT-Type Members Comment
In the result/Output I want both the result combining of File1 and File2. So it will be easy to search the hostnames/IP's
CBIG_SIN is the CSV file name.
