<?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: Need help to crate query to pull values from multiple lines in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606995#M49820</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224955"&gt;@JacekF&lt;/a&gt;...&lt;/P&gt;&lt;P&gt;Thank you very much for your help on the query..!! This modified query is giving me the expected tabular results.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jul 2022 08:38:08 GMT</pubDate>
    <dc:creator>Mrig342</dc:creator>
    <dc:date>2022-07-26T08:38:08Z</dc:date>
    <item>
      <title>How to create a search to pull values from multiple lines?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606802#M49802</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:
    "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;&lt;SPAN&gt;I created the query which give the below table:&lt;/SPAN&gt;&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;&lt;SPAN&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;/SPAN&gt;&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;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 16:05:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606802#M49802</guid>
      <dc:creator>Mrig342</dc:creator>
      <dc:date>2022-07-25T16:05:57Z</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/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606824#M49803</link>
      <description>&lt;P&gt;Try add&amp;nbsp;&lt;SPAN&gt;max_match=0 argument to the rex command.&lt;BR /&gt;&lt;BR /&gt;| rex&amp;nbsp;max_match=0 field=_raw &amp;lt;rest of your rex code&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 11:01:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606824#M49803</guid>
      <dc:creator>JacekF</dc:creator>
      <dc:date>2022-07-25T11:01:55Z</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/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606838#M49804</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224955"&gt;@JacekF&lt;/a&gt;...&lt;/P&gt;&lt;P&gt;Using max_match=0 didn't work..&amp;nbsp;I tried using max_match=0 after removing&amp;nbsp;&lt;SPAN&gt;"CLIENT-ID\s" and that didn't work either..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you please modify it some other way to get the expected result..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you..!!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 12:43:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606838#M49804</guid>
      <dc:creator>Mrig342</dc:creator>
      <dc:date>2022-07-25T12:43:49Z</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/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606903#M49810</link>
      <description>&lt;P&gt;The following returns table you are expecting:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|  makeresults
| eval data="    \"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"
| rex max_match=0 field=data "\n(?&amp;lt;Group&amp;gt;[^\s]+)\s(?&amp;lt;Topic&amp;gt;[^\s]+)\s(?&amp;lt;Partition&amp;gt;[^\s]+)\s+(?&amp;lt;Current_Offset&amp;gt;[^\s]+)\s+(?&amp;lt;Log_End_Offset&amp;gt;[^\s]+)\s+(?&amp;lt;Lag&amp;gt;[^\s]+)\s+(?&amp;lt;Consumer_ID&amp;gt;[^\s]+)\s*(?&amp;lt;Host&amp;gt;[^\s]+)\s+(?&amp;lt;Client_ID&amp;gt;[^\s]+)"
| table Group,Topic,Partition,Lag,Consumer_ID
| eval Group=mvzip(Group, Topic)
| eval Group=mvzip(Group, Partition)
| eval Group=mvzip(Group, Lag)
| eval Group=mvzip(Group, Consumer_ID)
| fields Group
| mvexpand Group
| makemv Group delim=","
| eval Topic=mvindex(Group, 1)
| eval Partition = mvindex(Group, 2)
| eval Lag = mvindex(Group, 3)
| eval Consumer_ID=mvindex(Group, 4)
| eval Group=mvindex(Group, 0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jul 2022 16:03:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606903#M49810</guid>
      <dc:creator>JacekF</dc:creator>
      <dc:date>2022-07-25T16:03:38Z</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/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606995#M49820</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/224955"&gt;@JacekF&lt;/a&gt;...&lt;/P&gt;&lt;P&gt;Thank you very much for your help on the query..!! This modified query is giving me the expected tabular results.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jul 2022 08:38:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-create-a-search-to-pull-values-from-multiple-lines/m-p/606995#M49820</guid>
      <dc:creator>Mrig342</dc:creator>
      <dc:date>2022-07-26T08:38:08Z</dc:date>
    </item>
  </channel>
</rss>

