I am not a Splunk expert and wanted to know if I can use a field as my timeline. For example, if I have a year field in my XML extracted together with some value - can I show this on the timechart with the value as my y-axis and year as my x-axis?
Let's say you have the year value in field
myYear and value you want to timechart in field
myValue then you can try to do something like below and see if it works for your case:
your query to return myYear and myValue | chart count(myValue) over myYear
You can use
count, avg, min, max etc. whatever functions are of interest and apply to chart command. You can also
| sort myYear OR
| sort -myYear as the last line of the above command to achieve desired result of timechart, the way you like.
Thanks for the prompt response.
Can this be used to display multiple fields? So if there 3 data items like Country, Value & Year - can I display the Value for multiple countries over Year using Chart?
How do you expect a value of "Country" and "Value" to come in visualization? However if the question is "can one plot multiple series over year", yes you can do as follows:
your query to return myYear and myValue | chart count(myValue), min(yourValue), max(everyOnesValue) over myYear
Thanks for your suggestions - much appreciated and have now managed to use the following:-
... | chart sum(myValue) over myYear by myCountry
This seems to be working and thanks again.