<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Extract_values from String and plot the graph accordingly in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194954#M44898</link>
    <description>&lt;P&gt;Try this:- I am not sure what format your time value is, So I am just taking this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex " time (?&amp;lt;timestamp&amp;gt;[^,]+)"| rex max_match=0 "(?&amp;lt;type&amp;gt;\w+)=(?&amp;lt;value&amp;gt;[^ ]+)" | table timestamp, type, value| eval newfield=mvzip(type,value) | mvexpand newfield | rex field=newfield "(?&amp;lt;type&amp;gt;.*),(?&amp;lt;value&amp;gt;.*)" | chart first(value) over type by timestamp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Mar 2014 18:39:03 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2014-03-19T18:39:03Z</dc:date>
    <item>
      <title>Extract_values from String and plot the graph accordingly</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194951#M44895</link>
      <description>&lt;P&gt;Hi,I have the following string  which is continuously changing its type1,2,3 values ..&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;"msg count 95, time 2000111, rate: type1=0 type2=9.5 type3=0 type4=0 type5=8"&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;the value of {type1,type2,type3,type4,type5 } and time is changing in each message.&lt;/P&gt;

&lt;P&gt;I want to plot a Bar-chart graph in which time is on X-axis and {type1, type2,..} value is on y-axis&lt;BR /&gt;
how can I extract all the " typen=value" and plot the graph accordingly to value with my own time field also..&lt;/P&gt;

&lt;P&gt;Thanks. &lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2014 16:19:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194951#M44895</guid>
      <dc:creator>irfanh</dc:creator>
      <dc:date>2014-03-19T16:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: Extract_values from String and plot the graph accordingly</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194952#M44896</link>
      <description>&lt;P&gt;You could do this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| table timestamp type*
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And then choose the type of chart that you want in the "Visualization" tab.&lt;/P&gt;

&lt;P&gt;This assumes that you do not need to summarize the data. If you need to calculate the values for a span of an hour, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;yoursearchhere
| eval timestamp=strptime(yourtimestamp,"%format")
| bucket timestamp span=1h
| chart avg(type*) as type* by timestamp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This assumes that your timestamp field is &lt;EM&gt;not&lt;/EM&gt; in Linux epoch time format. If it is, you can leave off the &lt;CODE&gt;eval&lt;/CODE&gt; command. &lt;CODE&gt;"%format"&lt;/CODE&gt; depends on the format of your timestamp - you can get more information here: &lt;A href="http://docs.splunk.com/Documentation/Splunk/6.0.2/SearchReference/Commontimeformatvariables"&gt;Splunk common time format variables&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2014 17:14:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194952#M44896</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-03-19T17:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Extract_values from String and plot the graph accordingly</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194953#M44897</link>
      <description>&lt;P&gt;Thanks Lguinn, for your reply &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Actually my string has these values whic is changing&lt;/P&gt;

&lt;P&gt;time 2000111, rate: 20=3 22=9.5 25=0 26=2&lt;BR /&gt;
time 2000137, rate: 20=7 22=5.6 25=3 26=0&lt;BR /&gt;
time 2000092, rate: 20=0 22=9.5 25=0 26=0&lt;/P&gt;

&lt;P&gt;I want to plot a real-time graph which look like this. a) Each time parse the sting and Extract the values of {20,22,25,26,50,51} and store it to some variables like 20=x,22=y,25=z..so on. and then plot a bar chart according to(X,Y,Z) and time in the string as refernece..       &lt;/P&gt;

&lt;P&gt;I don't know how to extact values and store them into variables &lt;BR /&gt;
a Please help .. &lt;BR /&gt;
thanks again&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2014 18:06:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194953#M44897</guid>
      <dc:creator>irfanh</dc:creator>
      <dc:date>2014-03-19T18:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Extract_values from String and plot the graph accordingly</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194954#M44898</link>
      <description>&lt;P&gt;Try this:- I am not sure what format your time value is, So I am just taking this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search | rex " time (?&amp;lt;timestamp&amp;gt;[^,]+)"| rex max_match=0 "(?&amp;lt;type&amp;gt;\w+)=(?&amp;lt;value&amp;gt;[^ ]+)" | table timestamp, type, value| eval newfield=mvzip(type,value) | mvexpand newfield | rex field=newfield "(?&amp;lt;type&amp;gt;.*),(?&amp;lt;value&amp;gt;.*)" | chart first(value) over type by timestamp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Mar 2014 18:39:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194954#M44898</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-03-19T18:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extract_values from String and plot the graph accordingly</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194955#M44899</link>
      <description>&lt;P&gt;Wo0W Great ! &lt;/P&gt;

&lt;P&gt;Thanks alot man.it works fine in tabular form extract the values of type and also show the time-stamp..&lt;/P&gt;

&lt;P&gt;i just want to show the type field which is {20.23.25.50.56}&lt;BR /&gt;
and its values on the bar graph. Does it works ?? on graph it shows some thing strange..&lt;/P&gt;

&lt;P&gt;thanks again&lt;BR /&gt;
..&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2014 19:27:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Extract-values-from-String-and-plot-the-graph-accordingly/m-p/194955#M44899</guid>
      <dc:creator>irfanh</dc:creator>
      <dc:date>2014-03-19T19:27:55Z</dc:date>
    </item>
  </channel>
</rss>

