I am new to Hive, please help with the syntax..below are the 2 columns ( filepath, filesize (bytes) ) from the table logstash....

```
/bns/ghi/cod/cob_def/abc                        | 10600
/sandbox/abc/def/xyz/ade                        | 1062659
/data/def/cag/tyz/gj/ibs                        | 457869
/tmp/cdb/def/ghik/new_data/2018-08-17           | 14565
/data/abc/def/ghi/new_data                      | 56453

```

I was able to get the sum filesizes to first level,....

Similarly how do i extract second level eg: ( /data/abc, /bns/ghi, /tmp/cbd )
Eg; If /data is 100 GB I need to know what’s inside /data which is something like /data/def =20 GB /data/efg = 20 GB... and similarly 3rd level

```
**select substr(filepathpath, 2, instr(substr(filepath,2), '/')-2) zone, 
   sum(filesize)from logstash group by substr(filepath, 2, instr(substr(filepath,2), '/')-2)**

```