<?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 How do I print last 2 columns in a line and do a line chart on those values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528736#M149274</link>
    <description>&lt;P&gt;Hello Tem,&lt;/P&gt;&lt;P&gt;I have log like below and I want to extract 3 fields and its values like below and do a line chart for top 20 tables which has higher numbers.&lt;/P&gt;&lt;P&gt;TableName: test.table1&lt;/P&gt;&lt;P&gt;Ops:10&lt;/P&gt;&lt;P&gt;data:30&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Log:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;INFO [Service Thread] 2020-11-09 19:22:13,294 StatusLogger.java:98 - &lt;STRONG&gt;Table&lt;/STRONG&gt; &lt;STRONG&gt;Memtable&lt;/STRONG&gt; &lt;STRONG&gt;ops&lt;/STRONG&gt;,&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;BR /&gt;INFO [Service Thread] 2020-11-09 19:22:13,294 StatusLogger.java:101 -&lt;STRONG&gt; test.table1&lt;/STRONG&gt; &lt;STRONG&gt;10,30&lt;/STRONG&gt;&lt;BR /&gt;INFO [Service Thread] 2020-11-09 19:22:13,294 StatusLogger.java:101 -test.table2 10000,99999999&lt;/P&gt;</description>
    <pubDate>Mon, 09 Nov 2020 20:31:27 GMT</pubDate>
    <dc:creator>chandukreddi</dc:creator>
    <dc:date>2020-11-09T20:31:27Z</dc:date>
    <item>
      <title>How do I print last 2 columns in a line and do a line chart on those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528736#M149274</link>
      <description>&lt;P&gt;Hello Tem,&lt;/P&gt;&lt;P&gt;I have log like below and I want to extract 3 fields and its values like below and do a line chart for top 20 tables which has higher numbers.&lt;/P&gt;&lt;P&gt;TableName: test.table1&lt;/P&gt;&lt;P&gt;Ops:10&lt;/P&gt;&lt;P&gt;data:30&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Log:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;INFO [Service Thread] 2020-11-09 19:22:13,294 StatusLogger.java:98 - &lt;STRONG&gt;Table&lt;/STRONG&gt; &lt;STRONG&gt;Memtable&lt;/STRONG&gt; &lt;STRONG&gt;ops&lt;/STRONG&gt;,&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;BR /&gt;INFO [Service Thread] 2020-11-09 19:22:13,294 StatusLogger.java:101 -&lt;STRONG&gt; test.table1&lt;/STRONG&gt; &lt;STRONG&gt;10,30&lt;/STRONG&gt;&lt;BR /&gt;INFO [Service Thread] 2020-11-09 19:22:13,294 StatusLogger.java:101 -test.table2 10000,99999999&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 20:31:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528736#M149274</guid>
      <dc:creator>chandukreddi</dc:creator>
      <dc:date>2020-11-09T20:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: How do I print last 2 columns in a line and do a line chart on those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528751#M149282</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/72497"&gt;@chandukreddi&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This should get you started&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval event="INFO [Service Thread] 2020-11-09 19:22:13,294 StatusLogger.java:98 - Table Memtable ops,data$INFO [Service Thread] 2020-11-09 19:22:13,294 StatusLogger.java:101 - test.table1 10,30$INFO [Service Thread] 2020-11-09 19:22:13,294 StatusLogger.java:101 - test.table2 10000,99999999"
| eval event=split(event,"$")
| mvexpand event
| rex field=event "(?&amp;lt;level&amp;gt;\w+) (?&amp;lt;thread&amp;gt;\[[^\]]+\]) (?&amp;lt;date&amp;gt;\d+-\d+-\d+ \d+:\d+:\d+,\d+) (?&amp;lt;file&amp;gt;[^:]*):(?&amp;lt;line_number&amp;gt;\d+) - (?&amp;lt;table&amp;gt;[^ ]*) (?&amp;lt;ops&amp;gt;\w+),(?&amp;lt;data&amp;gt;\w+)"
| where !isnull(table)
| eval _time=strptime(date,"%F %T,%Q")
| timechart span=1d limit=20 max(ops) as maxops by table&lt;/LI-CODE&gt;&lt;P&gt;This is all setting up your example data and then running a timechart.&lt;/P&gt;&lt;P&gt;It was not clear if you wanted a report over time on the x axis, or some other x axis. For example if you want the table to be on the x axis, use this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| chart max(ops) as maxops max(data) as data by table
| sort - maxops
| head 20&lt;/LI-CODE&gt;&lt;P&gt;Note that this will take the highest 20 ops, not data, so adjust as you need.&lt;/P&gt;&lt;P&gt;Also, if you are plotting ops and data on the same chart, you would need to use a second y axis for the second data point, given it is such a different scale to ops.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2020 23:05:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528751#M149282</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-11-09T23:05:52Z</dc:date>
    </item>
    <item>
      <title>Re: How do I print last 2 columns in a line and do a line chart on those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528844#M149322</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let me try and get back to you&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 15:46:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528844#M149322</guid>
      <dc:creator>chandukreddi</dc:creator>
      <dc:date>2020-11-10T15:46:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I print last 2 columns in a line and do a line chart on those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528883#M149329</link>
      <description>&lt;P&gt;I have tried like below but it returned nothing&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;source=/var/log/cassandra/system.log index=cassdb_perf StatusLogger.java:101 | rex field=Event "(?&amp;lt;level&amp;gt;\w+) (?&amp;lt;thread&amp;gt;\[[^\]]+\]) (?&amp;lt;date&amp;gt;\d+-\d+-\d+ \d+:\d+:\d+,\d+) (?&amp;lt;file&amp;gt;[^:]*):(?&amp;lt;line_number&amp;gt;\d+) - (?&amp;lt;table&amp;gt;[^ ]*) (?&amp;lt;ops&amp;gt;\w+),(?&amp;lt;data&amp;gt;\w+)"| where !isnull(table)&lt;BR /&gt;| eval _time=strptime(date,"%F %T,%Q")&lt;BR /&gt;| timechart span=1d limit=20 max(ops) as maxops by table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All I want is tablename , maxops, data as table columns so that I can sort the table columns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 20:23:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528883#M149329</guid>
      <dc:creator>chandukreddi</dc:creator>
      <dc:date>2020-11-10T20:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I print last 2 columns in a line and do a line chart on those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528892#M149331</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/72497"&gt;@chandukreddi&lt;/a&gt;&amp;nbsp;If it returns nothing, then it is most likely because your data does not match the rex statement.&lt;/P&gt;&lt;P&gt;In your original example post, you had slightly different formats (missing space after '-' in one line), so you will need to check your data to see how it matches the regex, or post your exact data here, so we can check it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 10 Nov 2020 21:46:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/528892#M149331</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2020-11-10T21:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: How do I print last 2 columns in a line and do a line chart on those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/529171#M149409</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the sample data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;INFO [Service Thread] 2020-11-12 15:01:51,663 StatusLogger.java:98 - Table Memtable ops,data&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,663 StatusLogger.java:101 - pqs_ca_e2e.au_report 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - pqs_ca_e2e.au_product 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - pqs_ca_e2e.au_audience_type 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - pqs_ca_e2e.au_version 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - taskservice_dev.tasks_by_duedate 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - taskservice_dev.tasks_by_type 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - taskservice_dev.task_actions 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - taskservice_dev.tasks_by_client 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - taskservice_dev.tasks_by_createddate 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - taskservice_dev.configuration_parameter 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - taskservice_dev.tasks_by_noduedate 0,0&lt;BR /&gt;INFO [Service Thread] 2020-11-12 15:01:51,664 StatusLogger.java:101 - taskservice_dev.tasks_by_assigned 0,0&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Chandra&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 16:45:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/529171#M149409</guid>
      <dc:creator>chandukreddi</dc:creator>
      <dc:date>2020-11-12T16:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I print last 2 columns in a line and do a line chart on those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/529172#M149410</link>
      <description>&lt;P&gt;some more data which&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;INFO [Service Thread] 2020-11-12 15:01:51,674 StatusLogger.java:101 - qa.lookup 91,53257&lt;/P&gt;&lt;P&gt;INFO [Service Thread] 2020-11-12 15:01:51,685 StatusLogger.java:101 - data_e2estatus 416,69936&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 16:47:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/529172#M149410</guid>
      <dc:creator>chandukreddi</dc:creator>
      <dc:date>2020-11-12T16:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I print last 2 columns in a line and do a line chart on those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/529178#M149414</link>
      <description>&lt;P&gt;But this thing is working as you mentioned but when I query index it's not working as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;| makeresults&lt;BR /&gt;| eval event="INFO [Service Thread] 2020-11-12 15:01:51,674 StatusLogger.java:101 - qa.lookup 91,53257$INFO [Service Thread] 2020-11-12 15:01:51,685 StatusLogger.java:101 - data_e2estatus 416,69936"&lt;BR /&gt;| eval event=split(event,"$")&lt;BR /&gt;| mvexpand event&lt;BR /&gt;| rex field=event "(?&amp;lt;level&amp;gt;\w+) (?&amp;lt;thread&amp;gt;\[[^\]]+\]) (?&amp;lt;date&amp;gt;\d+-\d+-\d+ \d+:\d+:\d+,\d+) (?&amp;lt;file&amp;gt;[^:]*):(?&amp;lt;line_number&amp;gt;\d+) - (?&amp;lt;table&amp;gt;[^ ]*) (?&amp;lt;ops&amp;gt;\w+),(?&amp;lt;data&amp;gt;\w+)"&lt;BR /&gt;| where !isnull(table)&lt;BR /&gt;| eval _time=strptime(date,"%F %T,%Q")&lt;BR /&gt;| timechart span=1d limit=20 max(ops) as maxops by table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Nov 2020 17:12:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/529178#M149414</guid>
      <dc:creator>chandukreddi</dc:creator>
      <dc:date>2020-11-12T17:12:38Z</dc:date>
    </item>
    <item>
      <title>Re: How do I print last 2 columns in a line and do a line chart on those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/529635#M149598</link>
      <description>&lt;P&gt;Can anyone help me with this?&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 21:25:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/529635#M149598</guid>
      <dc:creator>chandukreddi</dc:creator>
      <dc:date>2020-11-16T21:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I print last 2 columns in a line and do a line chart on those values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/529639#M149600</link>
      <description>&lt;P&gt;Try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;source=/var/log/cassandra/system.log index=cassdb_perf StatusLogger.java:101
| rex "StatusLogger\.java\:\d+\s+-\s+(?&amp;lt;TableName&amp;gt;\S+)\s+(?&amp;lt;ops&amp;gt;\d+),(?&amp;lt;data&amp;gt;\d+)$"
| where isnotnull(data)
| table TableName ops data&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 16 Nov 2020 21:42:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-print-last-2-columns-in-a-line-and-do-a-line-chart-on/m-p/529639#M149600</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-11-16T21:42:41Z</dc:date>
    </item>
  </channel>
</rss>

