<?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 Need help to create query to pull values from multiple lines in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-to-create-query-to-pull-values-from-multiple-lines/m-p/606763#M49797</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have logs like below and want to create a table out of it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;log1:
GROUP                                                                TOPIC                                            PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                                                                                            HOST            CLIENT-ID
connect-ABC ABC.sinkevents 0          15087148        15087148        0               connector-consumer-ABC /10.231.95.96   connector-consumer-ABC.sinkevents-0

log2:
GROUP                                                                       TOPIC                                                   PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                                                                                                   HOST            CLIENT-ID
connect-XYZ XYZ.cardtransactionauthorizationalertsent 0          27775           27780           5               connector-consumer-XYZ /10.231.95.97   connector-consumer-XYZ.Cardtransactionauthorizationalertsent-0
connect-XYZ XYZ.cardtransactionauthorizationalertsent 1          27740           27747           7               connector-consumer-XYZ /10.231.95.97   connector-consumer-XYZ.Cardtransactionauthorizationalertsent-0
connect-XYZ XYZ.cardtransactionauthorizationalertsent 2          27836           27836           0               connector-consumer-XYZ /10.231.95.97   connector-consumer-XYZ.Cardtransactionauthorizationalertsent-0&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created the query which give the below table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;.... | rex field=_raw "CLIENT\-ID\s+(?P&amp;lt;Group&amp;gt;[^\s]+)\s(?P&amp;lt;Topic&amp;gt;[^\s]+)\s(?P&amp;lt;Partition&amp;gt;[^\s]+)\s+(?P&amp;lt;Current_Offset&amp;gt;[^\s]+)\s+(?P&amp;lt;Log_End_Offset&amp;gt;[^\s]+)\s+(?P&amp;lt;Lag&amp;gt;[^\s]+)\s+(?P&amp;lt;Consumer_ID&amp;gt;[^\s]+)\s{0,20}(?P&amp;lt;Host&amp;gt;[^\s]+)\s+(?P&amp;lt;Client_ID&amp;gt;[^\s]+)" | table Group,Topic,Partition,Lag,Consumer_ID&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;Group&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Topic&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Partition&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Lag&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Consumer_ID&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-ABC&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;ABC.sinkevents&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-ABC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-XYZ&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;XYZ.cardtransactionauthorizationalertsent&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;5&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-XYZ&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Here I am missing the last 2 lines of log2.&amp;nbsp; I want to modify the query in a way that it produces the table in below manner:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;Group&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Topic&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Partition&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Lag&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Consumer_ID&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-ABC&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;ABC.sinkevents&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-ABC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-XYZ&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;XYZ.cardtransactionauthorizationalertsent&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;5&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-XYZ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-XYZ&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;XYZ.cardtransactionauthorizationalertsent&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;7&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-XYZ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-XYZ&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;XYZ.cardtransactionauthorizationalertsent&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-XYZ&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me to modify the query in a way to get my desired output.&lt;/P&gt;
&lt;P&gt;Your kind help on this is highly appreciated.&lt;/P&gt;
&lt;P&gt;Thank You..!!&lt;/P&gt;</description>
    <pubDate>Mon, 25 Jul 2022 14:56:53 GMT</pubDate>
    <dc:creator>Mrig342</dc:creator>
    <dc:date>2022-07-25T14:56:53Z</dc:date>
    <item>
      <title>Need help to create query to pull values from multiple lines</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-to-create-query-to-pull-values-from-multiple-lines/m-p/606763#M49797</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I have logs like below and want to create a table out of it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;log1:
GROUP                                                                TOPIC                                            PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                                                                                            HOST            CLIENT-ID
connect-ABC ABC.sinkevents 0          15087148        15087148        0               connector-consumer-ABC /10.231.95.96   connector-consumer-ABC.sinkevents-0

log2:
GROUP                                                                       TOPIC                                                   PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                                                                                                   HOST            CLIENT-ID
connect-XYZ XYZ.cardtransactionauthorizationalertsent 0          27775           27780           5               connector-consumer-XYZ /10.231.95.97   connector-consumer-XYZ.Cardtransactionauthorizationalertsent-0
connect-XYZ XYZ.cardtransactionauthorizationalertsent 1          27740           27747           7               connector-consumer-XYZ /10.231.95.97   connector-consumer-XYZ.Cardtransactionauthorizationalertsent-0
connect-XYZ XYZ.cardtransactionauthorizationalertsent 2          27836           27836           0               connector-consumer-XYZ /10.231.95.97   connector-consumer-XYZ.Cardtransactionauthorizationalertsent-0&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created the query which give the below table:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;.... | rex field=_raw "CLIENT\-ID\s+(?P&amp;lt;Group&amp;gt;[^\s]+)\s(?P&amp;lt;Topic&amp;gt;[^\s]+)\s(?P&amp;lt;Partition&amp;gt;[^\s]+)\s+(?P&amp;lt;Current_Offset&amp;gt;[^\s]+)\s+(?P&amp;lt;Log_End_Offset&amp;gt;[^\s]+)\s+(?P&amp;lt;Lag&amp;gt;[^\s]+)\s+(?P&amp;lt;Consumer_ID&amp;gt;[^\s]+)\s{0,20}(?P&amp;lt;Host&amp;gt;[^\s]+)\s+(?P&amp;lt;Client_ID&amp;gt;[^\s]+)" | table Group,Topic,Partition,Lag,Consumer_ID&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;Group&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Topic&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Partition&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Lag&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Consumer_ID&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-ABC&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;ABC.sinkevents&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-ABC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-XYZ&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;XYZ.cardtransactionauthorizationalertsent&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;5&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-XYZ&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Here I am missing the last 2 lines of log2.&amp;nbsp; I want to modify the query in a way that it produces the table in below manner:&lt;/P&gt;
&lt;TABLE border="1" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;Group&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Topic&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Partition&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Lag&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;Consumer_ID&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-ABC&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;ABC.sinkevents&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-ABC&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-XYZ&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;XYZ.cardtransactionauthorizationalertsent&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;5&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-XYZ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-XYZ&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;XYZ.cardtransactionauthorizationalertsent&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;1&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;7&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-XYZ&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD width="20%" height="25px"&gt;connect-XYZ&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;XYZ.cardtransactionauthorizationalertsent&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;2&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;0&lt;/TD&gt;
&lt;TD width="20%" height="25px"&gt;connector-consumer-XYZ&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please help me to modify the query in a way to get my desired output.&lt;/P&gt;
&lt;P&gt;Your kind help on this is highly appreciated.&lt;/P&gt;
&lt;P&gt;Thank You..!!&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 14:56:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-to-create-query-to-pull-values-from-multiple-lines/m-p/606763#M49797</guid>
      <dc:creator>Mrig342</dc:creator>
      <dc:date>2022-07-25T14:56:53Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to crate query to pull values from multiple lines</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-to-create-query-to-pull-values-from-multiple-lines/m-p/606765#M49798</link>
      <description>&lt;P&gt;The regex requires each line to begin with "CLIENT-ID\s", which is not the case for the last 2 lines in log2.&amp;nbsp; Removing that requirement in reg101.com matches all lines.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex "(?P&amp;lt;Group&amp;gt;[^\s]+)\s(?P&amp;lt;Topic&amp;gt;[^\s]+)\s(?P&amp;lt;Partition&amp;gt;[^\s]+)\s+(?P&amp;lt;Current_Offset&amp;gt;[^\s]+)\s+(?P&amp;lt;Log_End_Offset&amp;gt;[^\s]+)\s+(?P&amp;lt;Lag&amp;gt;[^\s]+)\s+(?P&amp;lt;Consumer_ID&amp;gt;[^\s]+)\s{0,20}(?P&amp;lt;Host&amp;gt;[^\s]+)\s+(?P&amp;lt;Client_ID&amp;gt;[^\s]+)"&lt;/LI-CODE&gt;</description>
      <pubDate>Sun, 24 Jul 2022 13:49:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-to-create-query-to-pull-values-from-multiple-lines/m-p/606765#M49798</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-07-24T13:49:17Z</dc:date>
    </item>
    <item>
      <title>Re: Need help to crate query to pull values from multiple lines</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-to-create-query-to-pull-values-from-multiple-lines/m-p/606768#M49799</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion..!! But it is not giving the expected result. May be this is because I missed to update that sometimes there may be other lines before "GROUP" in the logs. My bad..!! Please consider the logs in this way and help me to create the query.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;log1:
    "connector": {
        "state": "RUNNING",
           },
    "tasks": [
        {
            "id": 0,
            "state": "RUNNING",
        }
    ],
    "type": "sink"
}
GROUP                                                                TOPIC                                            PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                                                                                            HOST            CLIENT-ID
connect-ABC ABC.sinkevents 0          15087148        15087148        0               connector-consumer-ABC /10.231.95.96   connector-consumer-ABC.sinkevents-0

log2:
    "connector": {
        "state": "RUNNING",
           },
    "tasks": [
        {
            "id": 0,
            "state": "FAILED",
        }
    ],
    "type": "sink"
}
GROUP                                                                       TOPIC                                                   PARTITION  CURRENT-OFFSET  LOG-END-OFFSET  LAG             CONSUMER-ID                                                                                                                   HOST            CLIENT-ID
connect-XYZ XYZ.cardtransactionauthorizationalertsent 0          27775           27780           5               connector-consumer-XYZ /10.231.95.97   connector-consumer-XYZ.Cardtransactionauthorizationalertsent-0
connect-XYZ XYZ.cardtransactionauthorizationalertsent 1          27740           27747           7               connector-consumer-XYZ /10.231.95.97   connector-consumer-XYZ.Cardtransactionauthorizationalertsent-0
connect-XYZ XYZ.cardtransactionauthorizationalertsent 2          27836           27836           0               connector-consumer-XYZ /10.231.95.97   connector-consumer-XYZ.Cardtransactionauthorizationalertsent-0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank You..!!&lt;/P&gt;</description>
      <pubDate>Sun, 24 Jul 2022 17:24:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Need-help-to-create-query-to-pull-values-from-multiple-lines/m-p/606768#M49799</guid>
      <dc:creator>Mrig342</dc:creator>
      <dc:date>2022-07-24T17:24:11Z</dc:date>
    </item>
  </channel>
</rss>

