How do I extract a part of a string in the message field in Kibana and then plot it on graph?

If all your log lines have a similar structure, it may be easier to instead use the dissect filter instead of grok. This blog post provides a good introduction.