---
title: Extract Business Data from Logged Messages
description: How to extract business data like Order Numbers, Customer IDs, and Invoice amounts from logged messages using Search Field Expressions.
---

# How do I extract business data like Order Numbers from logged messages?

**Use [Search Field Expressions][] to automatically extract Order Numbers, Customer IDs, Invoice amounts, and other business identifiers from your logged message bodies**—no manual parsing, no SQL queries.

## How It Works

1. **Define [Message Types][]** - Identify message formats: "PurchaseOrder#1.0", "Invoice#2.0", "CustomerUpdate#1.0"
2. **Include message body in [JSON Log Event][]** - Set `Body` field with XML, JSON, CSV, EDIFACT, or X12 content
3. **Create Search Field Expressions** - Configure extraction rules bound to Message Types
4. **<span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> extracts automatically** - When logs arrive, [Search Fields][] parse message bodies and extract business identifiers
5. **Business users search by business data** - [Log Views][] enable search: "Show me Order 12345" or "Export invoices >$10K for customer Contoso"

## Example: Extract Order Number from XML

**Message Type:** `PurchaseOrder#1.0`

**Logged message body (XML):**

```xml
<Order>
  <OrderId>PO-2025-001</OrderId>
  <CustomerId>CUST-12345</CustomerId>
  <OrderAmount>15750.50</OrderAmount>
  <OrderDate>2025-10-12</OrderDate>
</Order>
```

**Search Field Expression ([XPath][]):**

```xpath
/Order/OrderId/text()
```

**Result:** <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> automatically extracts `PO-2025-001` as searchable field. Business users search: "Order PO-2025-001" → finds transaction instantly.

## Example: Extract Customer ID from JSON

**Message Type:** `APIRequest#1.0`

**Logged message body (JSON):**

```json
{
  "requestId": "req-98765",
  "customerId": "CUST-Contoso",
  "endpoint": "/api/orders",
  "responseTime": 145
}
```

**Search Field Expression ([JSON Path][]):**

```jsonpath
$.customerId
```

**Result:** Extracts `CUST-Contoso`. Business users filter Log View: "Show all API requests for customer CUST-Contoso last week".

## Supported Extraction Methods

Search Field Expressions support multiple parsers:

* <i class="fal fa-code" aria-hidden="true"></i> **XPath** - XML messages (`/Order/OrderId/text()`)
* <i class="fal fa-brackets-curly" aria-hidden="true"></i> **JSON Path** - JSON messages (`$.order.orderId`, `$.items[0].sku`)
* <i class="fal fa-filter" aria-hidden="true"></i> **Regular Expressions** - Any text format (`Order ID: (\d+)`)
* <i class="fal fa-file-lines" aria-hidden="true"></i> **Flat File parsers** - CSV, fixed-width, delimited formats
* <i class="fal fa-function" aria-hidden="true"></i> [Formula][] - Complex transformations, concatenation, conditional logic

## Multiple Search Fields Per Message Type

Extract multiple business identifiers from same message:

**Message Type:** `PurchaseOrder#1.0`

* **Search Field 1:** `OrderId` (XPath: `/Order/OrderId/text()`)
* **Search Field 2:** `CustomerId` (XPath: `/Order/CustomerId/text()`)
* **Search Field 3:** `OrderAmount` (XPath: `/Order/OrderAmount/text()`)

**Result:** Business users search by any combination: "Orders from customer CUST-12345 with amount >$10K last month".

## Configuration Steps

1. **Navigate to Administration → Log Management → Search Fields**
2. **Create Search Field** - Name: "Order Number", Description: "PurchaseOrder identifier"
3. **Bind to Message Type** - Select "PurchaseOrder#1.0"
4. **Configure Expression** - Choose parser (XPath, JSON Path, Regex), enter extraction rule
5. **Test with sample** - Validate extraction with sample message body
6. **Save** - <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> applies to all future logs with that Message Type

**Existing logs:** Search Fields apply retroactively—re-index existing logs to extract business data from historical messages.

---

**Related Topics:**  
[Search Field Expressions Overview][]  
[Message Types][]  
[Formula for Complex Transformations][]  

**See all FAQs:** [Troubleshooting Overview][]

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

<i class="fal fa-book" aria-hidden="true"></i> [Back to Custom Logging Overview][Custom Logging Overview]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

* <i class="fal fa-question-circle" aria-hidden="true"></i> [Troubleshooting Overview][Troubleshooting]  

[Custom Logging Overview]:https://docs.nodinite.com/logging-and-monitoring/custom-logging/overview/
[Formula]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/
[Formula for Complex Transformations]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/overview/
[JSON Log Event]:https://docs.nodinite.com/core-services/log-event/features/json-log-event/
[JSON Path]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/json-path/
[Log Views]:https://docs.nodinite.com/administration/log-management/log-views/features/what-is-a-log-view/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[Search Field Expressions]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/
[Search Field Expressions Overview]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/overview/
[Search Fields]:https://docs.nodinite.com/administration/log-management/search-fields/features/what-is-a-search-field/
[Troubleshooting]:https://docs.nodinite.com/logging-and-monitoring/custom-logging/troubleshooting/overview/
[Troubleshooting Overview]:https://docs.nodinite.com/logging-and-monitoring/custom-logging/troubleshooting/overview/
[XPath]:https://docs.nodinite.com/administration/log-management/search-fields/features/search-field-expressions/formula/extract/xpath/