Aggregation on script field

Hi one below requirement, Can someone can help to for inputs for visualization.

I am looking to visualize the data lines should split by host name and should show graph only one app id with is having more count of records.
or
average of count of each appid .

Please let me know if question is not understandable.

data will be like below
host appid

xxx 123
xxx 123
xxx 234
xxx 234
xxx 234
yyy 123
yyy 123
yyy 234

Sorry, I'm not sure I follow. Perhaps a sketch of the graph you'd like to create would be a helpful example?